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
Using deep learning model to detect breast cancer.

Breast-Cancer-Detection Breast cancer is the most frequent cancer among women, with around one in every 19 women at risk. The number of cases of breas

1 Feb 13, 2022
This repository provides a PyTorch implementation and model weights for HCSC (Hierarchical Contrastive Selective Coding)

HCSC: Hierarchical Contrastive Selective Coding This repository provides a PyTorch implementation and model weights for HCSC (Hierarchical Contrastive

YUANFAN GUO 111 Dec 20, 2022
JAXDL: JAX (Flax) Deep Learning Library

JAXDL: JAX (Flax) Deep Learning Library Simple and clean JAX/Flax deep learning algorithm implementations: Soft-Actor-Critic (arXiv:1812.05905) Transf

Patrick Hart 4 Nov 27, 2022
A framework for attentive explainable deep learning on tabular data

🧠 kendrite A framework for attentive explainable deep learning on tabular data 💨 Quick start kedro run 🧱 Built upon Technology Description Links ke

Marnix Koops 3 Nov 06, 2021
A PyTorch-based Semi-Supervised Learning (SSL) Codebase for Pixel-wise (Pixel) Vision Tasks

PixelSSL is a PyTorch-based semi-supervised learning (SSL) codebase for pixel-wise (Pixel) vision tasks. The purpose of this project is to promote the

Zhanghan Ke 255 Dec 11, 2022
Code and datasets for the paper "KnowPrompt: Knowledge-aware Prompt-tuning with Synergistic Optimization for Relation Extraction"

KnowPrompt Code and datasets for our paper "KnowPrompt: Knowledge-aware Prompt-tuning with Synergistic Optimization for Relation Extraction" Requireme

ZJUNLP 137 Dec 31, 2022
Code for reproducing our paper: LMSOC: An Approach for Socially Sensitive Pretraining

LMSOC: An Approach for Socially Sensitive Pretraining Code for reproducing the paper LMSOC: An Approach for Socially Sensitive Pretraining to appear a

Twitter Research 11 Dec 20, 2022
Lua-parser-lark - An out-of-box Lua parser written in Lark

An out-of-box Lua parser written in Lark Such parser handles a relaxed version o

Taine Zhao 2 Jul 19, 2022
Sleep staging from ECG, assisted with EEG

Sleep_Staging_Knowledge Distillation This codebase implements knowledge distillation approach for ECG based sleep staging assisted by EEG based sleep

2 Dec 12, 2022
Probabilistic Tracklet Scoring and Inpainting for Multiple Object Tracking

Probabilistic Tracklet Scoring and Inpainting for Multiple Object Tracking (CVPR 2021) Pytorch implementation of the ArTIST motion model. In this repo

Fatemeh 38 Dec 12, 2022
DROPO: Sim-to-Real Transfer with Offline Domain Randomization

DROPO: Sim-to-Real Transfer with Offline Domain Randomization Gabriele Tiboni, Karol Arndt, Ville Kyrki. This repository contains the code for the pap

Gabriele Tiboni 8 Dec 19, 2022
Code repo for "RBSRICNN: Raw Burst Super-Resolution through Iterative Convolutional Neural Network" (Machine Learning and the Physical Sciences workshop in NeurIPS 2021).

RBSRICNN: Raw Burst Super-Resolution through Iterative Convolutional Neural Network An official PyTorch implementation of the RBSRICNN network as desc

Rao Muhammad Umer 6 Nov 14, 2022
Simple tutorials on Pytorch DDP training

pytorch-distributed-training Distribute Dataparallel (DDP) Training on Pytorch Features Easy to study DDP training You can directly copy this code for

Ren Tianhe 188 Jan 06, 2023
Constrained Language Models Yield Few-Shot Semantic Parsers

Constrained Language Models Yield Few-Shot Semantic Parsers This repository contains tools and instructions for reproducing the experiments in the pap

Microsoft 43 Nov 23, 2022
ETMO: Evolutionary Transfer Multiobjective Optimization

ETMO: Evolutionary Transfer Multiobjective Optimization To promote the research on ETMO, benchmark problems are of great importance to ETMO algorithm

Songbai Liu 0 Mar 16, 2021
An end-to-end machine learning web app to predict rugby scores (Pandas, SQLite, Keras, Flask, Docker)

Rugby score prediction An end-to-end machine learning web app to predict rugby scores Overview An demo project to provide a high-level overview of the

34 May 24, 2022
Amazon Forest Computer Vision: Satellite Image tagging code using PyTorch / Keras with lots of PyTorch tricks

Amazon Forest Computer Vision Satellite Image tagging code using PyTorch / Keras Here is a sample of images we had to work with Source: https://www.ka

Mamy Ratsimbazafy 359 Jan 05, 2023
[CVPR 2022 Oral] Balanced MSE for Imbalanced Visual Regression https://arxiv.org/abs/2203.16427

Balanced MSE Code for the paper: Balanced MSE for Imbalanced Visual Regression Jiawei Ren, Mingyuan Zhang, Cunjun Yu, Ziwei Liu CVPR 2022 (Oral) News

Jiawei Ren 267 Jan 01, 2023
JugLab 33 Dec 30, 2022
Active Offline Policy Selection With Python

Active Offline Policy Selection This is supporting example code for NeurIPS 2021 paper Active Offline Policy Selection by Ksenia Konyushkova*, Yutian

DeepMind 27 Oct 15, 2022