MOT Tracking By Detection Pipeline Save

Tracking-by-Detection形式のMOT(Multi Object Tracking)について、 DetectionとTrackingの処理を分離して寄せ集めたフレームワーク(Tracking-by-Detection method MOT(Multi Object Tracking) is a framework that separates the processing of Detection and Tracking.)

Project README

[Japanese/English]

MOT-Tracking-by-Detection-Pipeline

Tracking-by-Detection形式のMOT(Multi Object Tracking)について、
DetectionとTrackingの処理を分離して寄せ集めたフレームワークです。



https://user-images.githubusercontent.com/37477845/154089051-708b70c7-661a-4754-a5d8-556f9291e4c9.mp4


Requirement

opencv-python 4.5.5.62 or later
onnxruntime 1.10.0     or later
mediapipe 0.8.9.1      or later ※MediaPipeを実行する場合
filterpy 1.4.5         or later ※motpyを実行する場合
lap 0.4.0              or later ※ByteTrackを実行する場合
Cython 0.29.27         or later ※ByteTrackを実行する場合
cython_bbox 0.1.3      or later ※ByteTrackを実行する場合
rich 11.2.0            or later ※Norfairを実行する場合
gdown 4.4.0            or later ※YoutuReIDを実行する場合
tensorflow 2.8.0       or later ※Light Person Detectorをtfliteで実行する場合

※Windowsでcython_bbox のインストールが失敗する場合は、GitHubからのインストールをお試しください(2022/02/16時点)

pip install -e git+https://github.com/samson-wang/cython_bbox.git#egg=cython-bbox

Usage

デモの実行方法は以下です。

python main.py
  • --device
    カメラデバイス番号の指定
    デフォルト:0
  • --movie
    動画ファイルの指定 ※指定時はカメラデバイスより優先
    デフォルト:指定なし
  • --detector
    Object Detectionのモデル選択
    yolox, efficientdet, ssd, centernet, nanodet, mediapipe_face, mediapipe_hand, light_person_detector の何れかを指定
    デフォルト:yolox
  • --tracker
    トラッキングアルゴリズムの選択
    motpy, bytetrack, mc_bytetrack, norfair, mc_norfair, person_reid, youtureid, sface の何れかを指定
    デフォルト:motpy
  • --target_id
    トラッキング対象のクラスIDを指定
    複数指定する場合はカンマ区切りで指定 ※Noneの場合は全てを対象とする
    例:--target_id=1
    例:--target_id=1,3
    デフォルト:None
  • --use_gpu
    GPU推論するか否か
    デフォルト:指定なし

Direcotry

│  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

各モデル、トラッキングアルゴリズムを格納しているディレクトリには、
ライセンス条項とコンフィグを同梱しています。

Detector

モデル名 取得元リポジトリ ライセンス 備考
YOLOX Megvii-BaseDetection/YOLOX Apache-2.0 YOLOX-ONNX-TFLite-Sampleにて
ONNX化したモデルを使用
EfficientDet tensorflow/models Apache-2.0 Object-Detection-API-TensorFlow2ONNXにて
ONNX化したモデルを使用
SSD MobileNet v2 FPNLite tensorflow/models Apache-2.0 Object-Detection-API-TensorFlow2ONNXにて
ONNX化したモデルを使用
CenterNet tensorflow/models Apache-2.0 Object-Detection-API-TensorFlow2ONNXにて
ONNX化したモデルを使用
NanoDet RangiLyu/nanodet Apache-2.0 NanoDet-ONNX-Sampleにて
ONNX化したモデルを使用
MediaPipe Face Detection google/mediapipe Apache-2.0 目、鼻、口、耳のキーポイントは未使用
MediaPipe Hands google/mediapipe Apache-2.0 ランドマークから外接矩形を算出し使用
Light Person Detector Person-Detection-using-RaspberryPi-CPU Apache-2.0 -

Tracker

アルゴリズム名 取得元リポジトリ ライセンス 備考
motpy
(0.0.10)
wmuron/motpy MIT -
ByteTrack
(2022/01/26)
ifzhang/ByteTrack MIT ByteTrackはシングルクラス用トラッカー
マルチクラス拡張版を使用したい場合は「mc_bytetrack」を指定してください
Norfair
(0.4.0)
tryolabs/norfair BSD 3-Clause Norfairはシングルクラス用トラッカー
マルチクラス拡張版を使用したい場合は「mc_norfiar」を指定してください
person-reidentification-retail openvinotoolkit/open_model_zoo Apache-2.0 ONNXモデルはPINTO0309/PINTO_model_zooから取得
人用モデルのため使用時はtarget_idオプションでクラスを指定してください
YoutuReID opencv/opencv_zoo Apache-2.0 人用モデルのため使用時はtarget_idオプションでクラスを指定してください
SFace opencv/opencv_zoo Apache-2.0 Detectorに顔検出を指定してください
また、SFaceは推論前に顔の角度を垂直に補正する処理を実施すべきですが、本ソースでは未対応です
vehicle-reid-0001 vehicle-reid-0001 Apache-2.0 車用モデルのため使用時はtarget_idオプションでクラスを指定してください

Author

高橋かずひと(https://twitter.com/KzhtTkhs)

License

MOT-Tracking-by-Detection-Pipeline is under MIT License.

MOT-Tracking-by-Detection-Pipelineのソースコード自体はMIT Licenseですが、
各アルゴリズムのソースコードは、それぞれのライセンスに従います。
詳細は各ディレクトリ同梱のLICENSEファイルをご確認ください。

License(Movie)

サンプル動画はNHKクリエイティブ・ライブラリーイタリア ミラノの横断歩道を使用しています。

Open Source Agenda is not affiliated with "MOT Tracking By Detection Pipeline" Project. README Source: Kazuhito00/MOT-Tracking-by-Detection-Pipeline

Open Source Agenda Badge

Open Source Agenda Rating