Object detection using deep learning and multi-object tracking
Pip install for OpenCV (version 3.4.3 or later) is available here and can be done with the following command:
pip install opencv-contrib-python
- Open the terminal
- Go to
yolo_dirin this repository:cd ./yolo_dir - Run:
sudo chmod +x ./get_yolo.sh - Run:
./get_yolo.sh
The model and the config files will be downloaded in ./yolo_dir. These will be used tracking-yolo-model.ipynb.
- The video input can be specified in the cell named
Initiate opencv video capture objectin the notebook. - To make the source as the webcam, use
video_src=0else provide the path of the video file (example:video_src="/path/of/videofile.mp4").
Example video used in above demo: https://flic.kr/p/L6qyxj
- Open the terminal
- Go to the tensorflow_model_dir:
cd ./tensorflow_model_dir - Run:
sudo chmod +x ./get_ssd_model.sh - Run:
./get_ssd_model.sh
This will download model and config files in ./tensorflow_model_dir. These will be used 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 objectin the notebook. - To make the source as the webcam, use
video_src=0else provide the path of the video file (example:video_src="/path/of/videofile.mp4").
Video used in SSD-Mobilenet multi-object detection and tracking: https://flic.kr/p/26WeEWy
- You have to use
tracking-caffe-model.ipynb. - The model for use is provided in the folder named
caffemodel_dir. - The video input can be specified in the cell named
Initiate opencv video capture objectin the notebook. - To make the source as the webcam, use
video_src=0else provide the path of the video file (example:video_src="/path/of/videofile.mp4").
The work here is based on the following literature available:
- http://elvera.nue.tu-berlin.de/files/1517Bochinski2017.pdf
- Pyimagesearch 1, 2
- correlationTracker
- Caffemodel zoo
- Caffemodel zoo GitHub
- YOLO v3
Use the caffemodel zoo from the reference [4,5] mentioned above to vary the CNN models and Play around with the codes.