- Python 3
- Clone this repo
git@github.com:nicholaskajoh/Vehicle-Counting.git
. - Create and/or use a virtual environment.
- Run
pip install -r requirements.txt
to install dependencies.
- Create .env from .env.example in the project root and edit as appropriate.
- Run
python -m main
.
Download vcs_demo_data.zip and unzip its contents in the data directory. It contains detection models and a sample video of a traffic scene.
python -m pytest
By default, the VCS runs in "debug mode" which provides you a window to monitor the vehicle counting process. You can press the s
key when the program is running to capture a screenshot and use q
to quit.
The vehicle counting system is made up of three main components: a detector, tracker and counter. The detector identifies vehicles in a given frame of video and returns a list of bounding boxes around the vehicles to the tracker. The tracker uses the bounding boxes to track the vehicles in subsequent frames. The detector is also used to update the trackers periodically to ensure that they are still tracking the vehicles correctly. The counter counts vehicles when they leave the frame or makes use of a counting line drawn across a road.
PS: You can find out about how the vehicle counting system was built by checking out this article on my blog: https://alphacoder.xyz/vehicle-counting/.
Love this project? You can buy me a coffee or two to support its continued development. 😊