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
A small tool to joint picture including gif

README 做设计的时候遇到拼接长图的情况,但是发现没有什么好用的能拼接gif的工具。 于是自己写了个gif拼接小工具。 可以自动拼接gif、png和jpg等常见格式。 效果 从上至下 从下至上 从左至右 从右至左 使用 克隆仓库 git clone https://github.com/Dels

3 Dec 15, 2021
Development Kit for the SoccerNet Challenge

SoccerNetv2-DevKit Welcome to the SoccerNet-V2 Development Kit for the SoccerNet Benchmark and Challenge. This kit is meant as a help to get started w

Silvio Giancola 117 Dec 30, 2022
Multivariate Time Series Transformer, public version

Multivariate Time Series Transformer Framework This code corresponds to the paper: George Zerveas et al. A Transformer-based Framework for Multivariat

363 Jan 03, 2023
Mall-Customers-Segmentation - Customer Segmentation Using K-Means Clustering

Overview Customer Segmentation is one the most important applications of unsupervised learning. Using clustering techniques, companies can identify th

NelakurthiSudheer 2 Jan 03, 2022
i3DMM: Deep Implicit 3D Morphable Model of Human Heads

i3DMM: Deep Implicit 3D Morphable Model of Human Heads CVPR 2021 (Oral) Arxiv | Poject Page This project is the official implementation our work, i3DM

Tarun Yenamandra 60 Jan 03, 2023
LSTMs (Long Short Term Memory) RNN for prediction of price trends

Price Prediction with Recurrent Neural Networks LSTMs BTC-USD price prediction with deep learning algorithm. Artificial Neural Networks specifically L

5 Nov 12, 2021
Deep learning toolbox based on PyTorch for hyperspectral data classification.

Deep learning toolbox based on PyTorch for hyperspectral data classification.

Nicolas 304 Dec 28, 2022
A style-based Quantum Generative Adversarial Network

Style-qGAN A style based Quantum Generative Adversarial Network (style-qGAN) model for Monte Carlo event generation. Tutorial We have prepared a noteb

9 Nov 24, 2022
Fibonacci Method Gradient Descent

An implementation of the Fibonacci method for gradient descent, featuring a TKinter GUI for inputting the function / parameters to be examined and a matplotlib plot of the function and results.

Emma 1 Jan 28, 2022
A powerful framework for decentralized federated learning with user-defined communication topology

Scatterbrained Decentralized Federated Learning Scatterbrained makes it easy to build federated learning systems. In addition to traditional federated

Johns Hopkins Applied Physics Laboratory 7 Sep 26, 2022
Miscellaneous and lightweight network tools

Network Tools Collection of miscellaneous and lightweight network tools to simplify daily operations, administration, and troubleshooting of networks.

Nicholas Russo 22 Mar 22, 2022
Hierarchical Attentive Recurrent Tracking

Hierarchical Attentive Recurrent Tracking This is an official Tensorflow implementation of single object tracking in videos by using hierarchical atte

Adam Kosiorek 147 Aug 07, 2021
Joint Channel and Weight Pruning for Model Acceleration on Mobile Devices

Joint Channel and Weight Pruning for Model Acceleration on Mobile Devices Abstract For practical deep neural network design on mobile devices, it is e

11 Dec 30, 2022
Supplementary code for the AISTATS 2021 paper "Matern Gaussian Processes on Graphs".

Matern Gaussian Processes on Graphs This repo provides an extension for gpflow with Matérn kernels, inducing variables and trainable models implemente

41 Dec 17, 2022
SIEM Logstash parsing for more than hundred technologies

LogIndexer Pipeline Logstash Parsing Configurations for Elastisearch SIEM and OpenDistro for Elasticsearch SIEM Why this project exists The overhead o

146 Dec 29, 2022
Anchor Retouching via Model Interaction for Robust Object Detection in Aerial Images

Anchor Retouching via Model Interaction for Robust Object Detection in Aerial Images In this paper, we present an effective Dynamic Enhancement Anchor

13 Dec 09, 2022
Personal thermal comfort models using digital twins: Preference prediction with BIM-extracted spatial-temporal proximity data from Build2Vec

Personal thermal comfort models using digital twins: Preference prediction with BIM-extracted spatial-temporal proximity data from Build2Vec This repo

Building and Urban Data Science (BUDS) Group 5 Dec 02, 2022
Codebase for the solution that won first place and was awarded the most human-like agent in the 2021 NeurIPS Competition MineRL BASALT Challenge.

KAIROS MineRL BASALT Codebase for the solution that won first place and was awarded the most human-like agent in the 2021 NeurIPS Competition MineRL B

Vinicius G. Goecks 37 Oct 30, 2022
(Preprint) Official PyTorch implementation of "How Do Vision Transformers Work?"

(Preprint) Official PyTorch implementation of "How Do Vision Transformers Work?"

xxxnell 656 Dec 30, 2022