The data has been obtained from a youtube video. Click here to download.
Due to the sheer size of the file I had to trim it down to approximately 30 sec to obtain results faster.
- Clone the repo and cd into it
$ git clone https://github.com/green-mint/traffic-counter-using-YOLO.git
$ cd traffic-counter-using-YOLO
- Download yolov3.weights and move them into the
yolov3
directory. Your directory structure should now be similar to
├── demo
│ └── traffic_counter.gif
├── input.mp4
├── README.md
├── requirements.txt
├── tracker.py
├── traffic_main.py
├── utils.py
└── yolov3
├── coco.names
├── yolov3.cfg
└── yolov3.weights
- Create a new python virtual environment and install the required libraries by running the following commands
$ python3 -m venv path/to/virtual/environment
$ source path/to/virtual/environment/bin/activate
$ pip install -r requirements.txt
- Run the
traffic-main.py
script to test your input video
$ python traffic-main.py --input/-i path/to/input/clip.mp4 --output/-o path/to/output/clip.avi
Additional optional arguments are --confidence/-c
and --threshold/-t
with default=0.5
and default=0.3
respectively
@article{redmon2016yolo9000,
title={YOLO9000: Better, Faster, Stronger},
author={Redmon, Joseph and Farhadi, Ali},
journal={arXiv preprint arXiv:1612.08242},
year={2016}
}
@inproceedings{Bewley2016_sort,
author={Bewley, Alex and Ge, Zongyuan and Ott, Lionel and Ramos, Fabio and Upcroft, Ben},
booktitle={2016 IEEE International Conference on Image Processing (ICIP)},
title={Simple online and realtime tracking},
year={2016},
pages={3464-3468},
keywords={Benchmark testing;Complexity theory;Detectors;Kalman filters;Target tracking;Visualization;Computer Vision;Data Association;Detection;Multiple Object Tracking},
doi={10.1109/ICIP.2016.7533003}
}