[Japanese/English]
Tracking-by-Detection method MOT(Multi Object Tracking) is a framework that separates the processing of Detection and Tracking.
09.MOT.mp4
opencv-python 4.5.5.62 or later
onnxruntime 1.10.0 or later
mediapipe 0.8.9.1 or later ※When using MediaPipe
filterpy 1.4.5 or later ※When using motpy
lap 0.4.0 or later ※When using ByteTrack
Cython 0.29.27 or later ※When using ByteTrack
cython_bbox 0.1.3 or later ※When using ByteTrack
rich 11.2.0 or later ※When using Norfair
gdown 4.4.0 or later ※When using YoutuReID
tensorflow 2.8.0 or later ※When using Light Person Detector with tflite
*If the installation of cython_bbox fails on Windows, please try the installation from GitHub (as of 2022/02/16).
pip install -e git+https://github.com/samson-wang/cython_bbox.git#egg=cython-bbox
Here's how to run the demo.
python main.py
- --device
Specifying the camera device number
Default:0 - --movie
Specify video file *When specified, priority is given to the camera device
Default:unspecified - --detector
Specifying the Object Detection method to use
Specify one of yolox, efficientdet, ssd, centernet, nanodet, mediapipe_face, mediapipe_hand, light_person_detector
Default:yolox - --tracker
Specifying the Tracking algorithm to use
Specify one of motpy, bytetrack, mc_bytetrack, norfair, mc_norfair, person_reid, youtureid, sface
Default:motpy - --target_id
Specify the class ID to be tracked
If you specify more than one, specify them separated by commas. *If None, all are targeted.
example:--target_id=1
example:--target_id=1,3
Default:None - --use_gpu
Whether to use GPU
Default:unspecified
│ main.py
│ test.mp4
├─Detector
│ │ detector.py
│ └─xxxxxxxx
│ │ xxxxxxxx.py
│ │ config.json
│ │ LICENSE
│ └─model
│ xxxxxxxx.onnx
└─Tracker
│ tracker.py
└─yyyyyyyy
│ yyyyyyyy.py
│ config.json
│ LICENSE
└─tracker
In the directory where each model and tracking algorithm are stored,
Includes license terms and config.
Model name | Source repository | License | Remarks |
---|---|---|---|
YOLOX | Megvii-BaseDetection/YOLOX | Apache-2.0 | Use the model that has been converted to ONNX in YOLOX-ONNX-TFLite-Sample |
EfficientDet | tensorflow/models | Apache-2.0 | Use the model that has been converted to ONNX in Object-Detection-API-TensorFlow2ONNX |
SSD MobileNet v2 FPNLite | tensorflow/models | Apache-2.0 | Use the model that has been converted to ONNX in Object-Detection-API-TensorFlow2ONNX |
CenterNet | tensorflow/models | Apache-2.0 | Use the model that has been converted to ONNX in Object-Detection-API-TensorFlow2ONNX |
NanoDet | RangiLyu/nanodet | Apache-2.0 | Use the model that has been converted to ONNX in NanoDet-ONNX-Sample |
MediaPipe Face Detection | google/mediapipe | Apache-2.0 | Unused eye, nose, mouth and ear key points |
MediaPipe Hands | google/mediapipe | Apache-2.0 | Calculate and use the circumscribed rectangle from the landmark |
Light Person Detector | Person-Detection-using-RaspberryPi-CPU | Apache-2.0 | - |
Algorithm name | Source repository | License | Remarks |
---|---|---|---|
motpy (0.0.10) |
wmuron/motpy | MIT | - |
ByteTrack (2022/01/26) |
ifzhang/ByteTrack | MIT | ByteTrack is a tracker for single class If you want to use the multi-class extended version, please specify "mc_bytetrack". |
Norfair (0.4.0) |
tryolabs/norfair | BSD 3-Clause | Norfair is a single-class tracker If you want to use the multi-class extended version, specify "mc_norfiar" |
person-reidentification-retail | openvinotoolkit/open_model_zoo | Apache-2.0 | ONNX model is obtained from PINTO0309/PINTO_model_zoo Because it is a human model, please specify the class with the target_id option when using it. |
YoutuReID | opencv/opencv_zoo | Apache-2.0 | Since it is a human model, please specify the class with the target_id option when using it. |
SFace | opencv/opencv_zoo | Apache-2.0 | Please specify face detection for Detector Also, SFace should perform processing to correct the angle of the face vertically before inference, but this source does not support it. |
Kazuhito Takahashi(https://twitter.com/KzhtTkhs)
MOT-Tracking-by-Detection-Pipeline is under MIT License.
The source code of MOT-Tracking-by-Detection-Pipeline itself is MIT License, but
The source code for each algorithm is subject to its own license.
For details, please check the LICENSE file included in each directory.
The sample video uses the "Pedestrian Crossing in Milan, Italy" from the NHK Creative Library.