Note: all approaches are stated at the end of this readme
cd yolo-coco
wget https://pjreddie.com/media/files/yolov3.weights
cd ..
python3 yolo_video.py --input highway_01.mp4 --output highway_01_out.mp4 --yolo yolo-coco
Pros:
- Handled hard shadows via Approach 2
- Used minimum object size; far away objects are not considered via Approach 1
To run the repo: use tf2.3.0
ref: link
Pros:
- Very fast - almost realtime
- Small objects are neglected (intended work because of random smaller detections via bg substraction)
Cons:
- Fails when there are hard shadow in the frame
- If a smaller car is present in the hard shadow of large truck then the whole truck + car = 1 vehicle
To address the above cons from Approach 1, I have used another repo which uses Yolo for vehicle detection
ref: link
Pros:
- Uses deep learning, so is better at detecting vehicles even if there are hard shadows
- Calculates centroid of last 10 frames and hence maintains correct count
Cons:
- As it uses yolo, it is little slower than opencv approach
- vehicles very far away in the frame are also counted, due to which count can get wrong sometimes
To address above cons, I simply added capabilities of Approach 1 into Approach 2 to make it more efficient.