ByteTrack(Multi-Object Tracking by Associating Every Detection Box)のPythonでのONNX推論サンプル

Overview

ByteTrack-ONNX-Sample

ByteTrack(Multi-Object Tracking by Associating Every Detection Box)のPythonでのONNX推論サンプルです。
ONNXに変換したモデルも同梱しています。
変換自体を試したい方はByteTrack_Convert2ONNX.ipynbを使用ください。
ByteTrack_Convert2ONNX.ipynbはColaboratory上での実行を想定しています。
書き動画はWindowsでの実行例です。

sample_.mp4

Requirement

opencv-python 4.5.3.56 or later
onnx 1.9.0 or later
onnxruntime-gpu 1.9.0 or later
Cython 0.29.24 or later
torch 1.8.1 or later
torchvision 0.9.1 or later
pycocotools 2.0.2 or later
scipy 1.6.3 or later
loguru 0.5.3 or later
thop 0.0.31.post2005241907 or later
lap 0.4.0 or later
cython_bbox 0.1.3 or later

※onnxruntime-gpuはonnxruntimeでも動作しますが、推論時間がかかるためGPUを推奨します
※Windowsでcython_bbox のインストールが失敗する場合は、GitHubからのインストールをお試しください(2021/11/19時点)
pip install -e git+https://github.com/samson-wang/cython_bbox.git#egg=cython-bbox

Demo

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

動画:動画に対しByteTrackで追跡した結果を動画出力します

python demo_video_onnx.py
実行時オプション
  • --use_debug_window
    動画書き込み時に書き込みフレームをGUI表示するか否か
    デフォルト:指定なし
  • --model
    ByteTrackのONNXモデル格納パス
    デフォルト:byte_tracker/model/bytetrack_s.onnx
  • --video
    入力動画の格納パス
    デフォルト:sample.mp4
  • --output_dir
    動画出力パス
    デフォルト:output
  • --score_th
    人検出のスコア閾値
    デフォルト:0.1
  • --score_th
    人検出のNMS閾値
    デフォルト:0.7
  • --input_shape
    推論時入力サイズ
    デフォルト:608,1088
  • --with_p6
    YOLOXモデルのFPN/PANでp6を含むか否か
    デフォルト:指定なし
  • --track_thresh
    追跡時のスコア閾値
    デフォルト:0.5
  • --track_buffer
    見失い時に何フレームの間、追跡対象を保持するか
    デフォルト:30
  • --match_thresh
    追跡時のマッチングスコア閾値
    デフォルト:0.8
  • --min-box-area
    最小のバウンディングボックスのサイズ閾値
    デフォルト:10
  • --mot20
    MOT20を使用しているか否か
    デフォルト:指定なし

Webカメラ:Webカメラ画像に対しByteTrackで追跡した結果をGUI表示します

python demo_webcam_onnx.py
実行時オプション
  • --model
    ByteTrackのONNXモデル格納パス
    デフォルト:byte_tracker/model/bytetrack_s.onnx
  • --device
    カメラデバイス番号の指定
    デフォルト:0
  • --width
    カメラキャプチャ時の横幅
    デフォルト:960
  • --height
    カメラキャプチャ時の縦幅
    デフォルト:540
  • --score_th
    人検出のスコア閾値
    デフォルト:0.1
  • --score_th
    人検出のNMS閾値
    デフォルト:0.7
  • --input_shape
    推論時入力サイズ
    デフォルト:608,1088
  • --with_p6
    YOLOXモデルのFPN/PANでp6を含むか否か
    デフォルト:指定なし
  • --track_thresh
    追跡時のスコア閾値
    デフォルト:0.5
  • --track_buffer
    見失い時に何フレームの間、追跡対象を保持するか
    デフォルト:30
  • --match_thresh
    追跡時のマッチングスコア閾値
    デフォルト:0.8
  • --min-box-area
    最小のバウンディングボックスのサイズ閾値
    デフォルト:10
  • --mot20
    MOT20を使用しているか否か
    デフォルト:指定なし

Reference

Author

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

License

ByteTrack-ONNX-Sample is under MIT License.

License(Movie)

サンプル動画はNHKクリエイティブ・ライブラリーイギリス ウースターのエルガー像を使用しています。

Owner
KazuhitoTakahashi
KazuhitoTakahashi
✅ How Robust are Fact Checking Systems on Colloquial Claims?. In NAACL-HLT, 2021.

How Robust are Fact Checking Systems on Colloquial Claims? Official PyTorch implementation of our NAACL paper: Byeongchang Kim*, Hyunwoo Kim*, Seokhee

Byeongchang Kim 19 Mar 15, 2022
audioLIME: Listenable Explanations Using Source Separation

audioLIME This repository contains the Python package audioLIME, a tool for creating listenable explanations for machine learning models in music info

Institute of Computational Perception 27 Dec 01, 2022
Codes for [NeurIPS'21] You are caught stealing my winning lottery ticket! Making a lottery ticket claim its ownership.

You are caught stealing my winning lottery ticket! Making a lottery ticket claim its ownership Codes for [NeurIPS'21] You are caught stealing my winni

VITA 8 Nov 01, 2022
Kaggleship: Kaggle Notebooks

Kaggleship: Kaggle Notebooks This repository contains my Kaggle notebooks. They are generally about data science, machine learning, and deep learning.

Erfan Sobhaei 1 Jan 25, 2022
Pytorch implementation code for [Neural Architecture Search for Spiking Neural Networks]

Neural Architecture Search for Spiking Neural Networks Pytorch implementation code for [Neural Architecture Search for Spiking Neural Networks] (https

Intelligent Computing Lab at Yale University 28 Nov 18, 2022
CHERRY is a python library for predicting the interactions between viral and prokaryotic genomes

CHERRY is a python library for predicting the interactions between viral and prokaryotic genomes. CHERRY is based on a deep learning model, which consists of a graph convolutional encoder and a link

Kenneth Shang 12 Dec 15, 2022
FcaNet: Frequency Channel Attention Networks

FcaNet: Frequency Channel Attention Networks PyTorch implementation of the paper "FcaNet: Frequency Channel Attention Networks". Simplest usage Models

327 Dec 27, 2022
WRENCH: Weak supeRvision bENCHmark

🔧 What is it? Wrench is a benchmark platform containing diverse weak supervision tasks. It also provides a common and easy framework for development

Jieyu Zhang 176 Dec 28, 2022
Repository relating to the CVPR21 paper TimeLens: Event-based Video Frame Interpolation

TimeLens: Event-based Video Frame Interpolation This repository is about the High Speed Event and RGB (HS-ERGB) dataset, used in the 2021 CVPR paper T

Robotics and Perception Group 544 Dec 19, 2022
My implementation of DeepMind's Perceiver

DeepMind Perceiver (in PyTorch) Disclaimer: This is not official and I'm not affiliated with DeepMind. My implementation of the Perceiver: General Per

Louis Arge 55 Dec 12, 2022
FFTNet vocoder implementation

Unofficial Implementation of FFTNet vocode paper. implement the model. implement tests. overfit on a single batch (sanity check). linearize weights fo

Eren Gölge 81 Dec 08, 2022
ML-PersonalWork - Big assignment PersonalWork in Machine Learning, 2021 autumn BUAA.

ML-PersonalWork - Big assignment PersonalWork in Machine Learning, 2021 autumn BUAA.

Snapdragon Lee 2 Dec 16, 2022
Spectralformer: Rethinking hyperspectral image classification with transformers

Spectralformer: Rethinking hyperspectral image classification with transformers Danfeng Hong, Zhu Han, Jing Yao, Lianru Gao, Bing Zhang, Antonio Plaza

Danfeng Hong 102 Dec 29, 2022
Geometric Deep Learning Extension Library for PyTorch

Documentation | Paper | Colab Notebooks | External Resources | OGB Examples PyTorch Geometric (PyG) is a geometric deep learning extension library for

Matthias Fey 16.5k Jan 08, 2023
RATCHET is a Medical Transformer for Chest X-ray Diagnosis and Reporting

RATCHET: RAdiological Text Captioning for Human Examined Thoraxes RATCHET is a Medical Transformer for Chest X-ray Diagnosis and Reporting. Based on t

26 Nov 14, 2022
Image Classification - A research on image classification and auto insurance claim prediction, a systematic experiments on modeling techniques and approaches

A research on image classification and auto insurance claim prediction, a systematic experiments on modeling techniques and approaches

0 Jan 23, 2022
CSAW-M: An Ordinal Classification Dataset for Benchmarking Mammographic Masking of Cancer

CSAW-M This repository contains code for CSAW-M: An Ordinal Classification Dataset for Benchmarking Mammographic Masking of Cancer. Source code for tr

Yue Liu 7 Oct 11, 2022
Vehicle direction identification consists of three module detection , tracking and direction recognization.

Vehicle-direction-identification Vehicle direction identification consists of three module detection , tracking and direction recognization. Algorithm

5 Nov 15, 2022
Datasets, Transforms and Models specific to Computer Vision

torchvision The torchvision package consists of popular datasets, model architectures, and common image transformations for computer vision. Installat

13.1k Jan 02, 2023
(3DV 2021 Oral) Filtering by Cluster Consistency for Large-Scale Multi-Image Matching

Scalable Cluster-Consistency Statistics for Robust Multi-Object Matching (3DV 2021 Oral Presentation) Filtering by Cluster Consistency (FCC) is a very

Yunpeng Shi 11 Sep 28, 2022