NOTE. This repository is no longer actively maintained by me. However, if others would like to make changes, please put up a Pull request and I'll do my best to merge the changes ASAP. Happy coding! :)
This repository is an implementation to perform realtime tracking with Tensorflow using a SSD model trained on the COCO dataset. It is based on the Simple Online and Realtime Tracking with a Deep Association Metric Deep SORT algorithm. See the original repository for more information.
It's recommended that this is run in a python virtual environment see here for more information. Ensure all of the dependencies in the Deep SORT are installed.
Then install the dependencies with:
pip3 install -r requirements.txt
- Download the SSD Model
- Copy the
frozen_inference_graph.pb
to the root directory of this repository. - Download the Label Map
- Copy
mscoco_label_map.pbtxt
that you just downloaded to the root directory of this repository.
Your directory structure should look something like this:
ObjectTracking/
threads/
utilities/
README.md
object_tracking.py
frozen_inference_graph.pb
mscoco_label_map.pbtxt
Run the file in your terminal by typing in python object_tracking.py
. The script will open up your webcam feed and begin detecting and tracking. The bounding boxes with the class labels are the result of detection from the SSD model. The overlayed blue bounding boxes are the output of the DeepSORT tracker.
If everything goes well, the system should be tracking in real time. Simply press Q
to exit.
Update: September 7, 2019
- As requested by some individuals, I've added an option to use video input instead of the webcam. Do so by typing
python object_tracking.py --input VIDEO_FILE.mp4
. By default, the video is set to constantly loop through. See thethreads/ImageInput/VideoThread.py
file for implementation. - Removed the Tensorflow Research See here dependencies. Instead, the file required from this repository is copied and can be found at
utilities/external/visualization.py
. I do not take credit for this file!
No issues found thus far, but please report any.