Git Product home page Git Product logo

kazuhito00 / mot-tracking-by-detection-pipeline Goto Github PK

View Code? Open in Web Editor NEW
62.0 4.0 11.0 447.83 MB

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.)

License: MIT License

Python 100.00%
mot multi-object-tracking tracking-by-detection bytetrack motpy norfair yolox efficientdet ssd centernet

mot-tracking-by-detection-pipeline's Introduction

[Japanese/English]

MOT-Tracking-by-Detection-Pipeline

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



09.MOT.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クリエイティブ・ライブラリーイタリア ミラノの横断歩道を使用しています。

mot-tracking-by-detection-pipeline's People

Contributors

kazuhito00 avatar scov8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mot-tracking-by-detection-pipeline's Issues

: cannot connect to X server

/usr/local/lib/python3.7/dist-packages/onnxruntime/capi/onnxruntime_inference_collection.py:56: UserWarning: Specified provider 'CUDAExecutionProvider' is not in available provider names.Available providers: 'CPUExecutionProvider'
"Available providers: '{}'".format(name, ", ".join(available_provider_names)))
Detector: yolox
Target ID: [1]
GPU: True
{ 'class_score_th': 0.3,
'input_shape': '416, 416',
'model_path': 'Detector/yolox/model/yolox_nano_416x416.onnx',
'nms_score_th': 0.1,
'nms_th': 0.45,
'with_p6': False}

Tracker: bytetrack
FPS: 29.97
GPU: False
{ 'match_thresh': 0.8,
'min_box_area': 10,
'mot20': False,
'track_buffer': 30,
'track_thresh': 0.5}

: cannot connect to X server

Can you help me with this? I am trying to run your code in google colab on your test video.

This is what I am trying to execute: !python main.py --movie test.mp4 --use_gpu --target_id=1 --tracker bytetrack

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.