Skip to content

Use object detection and tracking algorithm to plot the car routes

License

Notifications You must be signed in to change notification settings

chiluen/CarTracking

Repository files navigation

Car Tracking system


Introduction

This repository is based on this repo

In this repo, users can build a real-time tracker for cars. The output of the system is a video marked by the car route. In addition, the user can define red lines to calculate how many cars pass through these lines.

Preparation

  1. Clone the repository recursively:

git clone --recurse-submodules https://github.com/chiluen/CarTracking.git

  1. Run:

pip install -r requirements.txt

Running the code

Tracking can be run on most video formats

$ python track.py --source /path/to/video
                  --save-vid
                  --yolo_model yolo5s.pt
                  --line-distance 420,140,-1,-1 # red line(border) distance for[Up, Down, Left, Right]

After running the script, you will get the output.mp4 at ./runs/track/exp{number}, then you can use or follow Demo.ipynb to get the video in jupyter notebook.

About

Use object detection and tracking algorithm to plot the car routes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published