Skip to content

Quant-Foundry-Limited/multi-object-tracker

Repository files navigation

multi-object-tracker

Object detection using deep learning and multi-object tracking

DOI

YOLO

Video Source: link

Cars with YOLO

Tensorflow-SSD-MobileNet

Video Source: link

Cows with tf-SSD

Installation

Pip install for OpenCV (version 3.4.3 or later) is available here and can be done with the following command:

pip install numpy matplotlib scipy
pip install opencv-contrib-python

Installation of ipyfilechooser is recommended if you want to use the jupyter notebooks available in the examples folder.

pip install ipyfilechooser
git clone https://github.com/adipandas/multi-object-tracker
cd multi-object-tracker
pip install -e .

YOLO

Do the following in the terminal:

cd ./pretrained_models/yolo_weights
sudo chmod +x ./get_yolo.sh
./get_yolo.sh

The above commands will download the model and the config files in ./pretrained_models/yolo_weights. These weights are to be used in examples/tracking-yolo-model.ipynb.

  • The video input can be specified in the cell named Initiate opencv video capture object in the notebook.
  • To make the source as the webcam, use video_src=0 else provide the path of the video file (example: video_src="/path/of/videofile.mp4").

Example video used in above demo was taken from here

TensorFlow model

Do the following in the terminal:

cd ./pretrained_models/tensorflow_weights
sudo chmod +x ./get_ssd_model.sh
./get_ssd_model.sh

This will download model and config files in ./pretrained_models/tensorflow_weights. These will be used examples/tracking-tensorflow-ssd_mobilenet_v2_coco_2018_03_29.ipynb.

SSD-Mobilenet_v2_coco_2018_03_29 was used for this example. Other networks can be downloaded and ran: Go through tracking-tensorflow-ssd_mobilenet_v2_coco_2018_03_29.ipynb for more details.

  • The video input can be specified in the cell named Initiate opencv video capture object in the notebook.
  • To make the source as the webcam, use video_src=0 else provide the path of the video file (example: video_src="/path/of/videofile.mp4").

Video used in SSD-Mobilenet multi-object detection and tracking can be found here

Caffemodel

Do the following in the terminal

cd ./pretrained_models/caffemodel_weights
sudo chmod +x ./get_caffemodel.sh
./get_caffemodel.sh

This will download model and config files in ./pretrained_models/caffemodel_weights. These will be used examples/tracking-caffe-model-mobilenetSSD.ipynb.

The caffemodel example provided here also uses MobileNet-SSD model for detection.

References and Credits

This work is based on the following literature:

  1. Bochinski, E., Eiselein, V., & Sikora, T. (2017, August). High-speed tracking-by-detection without using image information. In 2017 14th IEEE International Conference on Advanced Video and Signal Based Surveillance (AVSS) (pp. 1-6). IEEE. [paper-pdf]
  2. Pyimagesearch link-1, link-2
  3. correlationTracker
  4. Caffemodel zoo
  5. Caffemodel zoo GitHub
  6. YOLO v3

Use the caffemodel zoo from the reference [4,5] mentioned above to vary the CNN models and Play around with the codes.

Suggestion: If you are looking for speed go for SSD-mobilenet. If you are looking for accurracy and speed go with YOLO. The best way is to train and fine tune your models on your dataset. Although, Faster-RCNN gives more accurate object detections, you will have to compromise on the detection speed as it is slower as compared to YOLO.

Citation

If you use this repository in your work, please consider citing it with:

@misc{multiobjtracker_amd2018,
  author = {Deshpande, Aditya M.},
  title = {adipandas/multi-object-tracker},
  year = {2018},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/adipandas/multi-object-tracker}},
}
@software{aditya_m_deshpande_2019_3530936,
  author       = {Aditya M. Deshpande},
  title        = {{adipandas/multi-object-tracker: multi-object- 
                   tracker}},
  month        = nov,
  year         = 2019,
  publisher    = {Zenodo},
  version      = {v4.0.0},
  doi          = {10.5281/zenodo.3530936},
  url          = {https://doi.org/10.5281/zenodo.3530936}
}

About

Multi-object trackers in Python

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%