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
Official implementation for (Show, Attend and Distill: Knowledge Distillation via Attention-based Feature Matching, AAAI-2021)

Show, Attend and Distill: Knowledge Distillation via Attention-based Feature Matching Official pytorch implementation of "Show, Attend and Distill: Kn

Clova AI Research 80 Dec 16, 2022
Official implementation of NeurIPS 2021 paper "One Loss for All: Deep Hashing with a Single Cosine Similarity based Learning Objective"

Official implementation of NeurIPS 2021 paper "One Loss for All: Deep Hashing with a Single Cosine Similarity based Learning Objective"

Ng Kam Woh 71 Dec 22, 2022
Code for the CVPR2021 workshop paper "Noise Conditional Flow Model for Learning the Super-Resolution Space"

NCSR: Noise Conditional Flow Model for Learning the Super-Resolution Space Official NCSR training PyTorch Code for the CVPR2021 workshop paper "Noise

57 Oct 03, 2022
This repository contains an overview of important follow-up works based on the original Vision Transformer (ViT) by Google.

This repository contains an overview of important follow-up works based on the original Vision Transformer (ViT) by Google.

75 Dec 02, 2022
This repo contains the official code of our work SAM-SLR which won the CVPR 2021 Challenge on Large Scale Signer Independent Isolated Sign Language Recognition.

Skeleton Aware Multi-modal Sign Language Recognition By Songyao Jiang, Bin Sun, Lichen Wang, Yue Bai, Kunpeng Li and Yun Fu. Smile Lab @ Northeastern

Isen (Songyao Jiang) 128 Dec 08, 2022
A package to predict protein inter-residue geometries from sequence data

trRosetta This package is a part of trRosetta protein structure prediction protocol developed in: Improved protein structure prediction using predicte

Ivan Anishchenko 185 Jan 07, 2023
[CVPR 2022 Oral] Versatile Multi-Modal Pre-Training for Human-Centric Perception

Versatile Multi-Modal Pre-Training for Human-Centric Perception Fangzhou Hong1  Liang Pan1  Zhongang Cai1,2,3  Ziwei Liu1* 1S-Lab, Nanyang Technologic

Fangzhou Hong 96 Jan 03, 2023
Sandbox for training deep learning networks

Deep learning networks This repo is used to research convolutional networks primarily for computer vision tasks. For this purpose, the repo contains (

Oleg Sémery 2.7k Jan 01, 2023
[NeurIPS-2021] Slow Learning and Fast Inference: Efficient Graph Similarity Computation via Knowledge Distillation

Efficient Graph Similarity Computation - (EGSC) This repo contains the source code and dataset for our paper: Slow Learning and Fast Inference: Effici

23 Nov 11, 2022
The reference baseline of final exam for XMU machine learning course

Mini-NICO Baseline The baseline is a reference method for the final exam of machine learning course. Requirements Installation we use /python3.7 /torc

JoaquinChou 3 Dec 29, 2021
TriMap: Large-scale Dimensionality Reduction Using Triplets

TriMap TriMap is a dimensionality reduction method that uses triplet constraints to form a low-dimensional embedding of a set of points. The triplet c

Ehsan Amid 235 Dec 24, 2022
[CVPR 21] Vectorization and Rasterization: Self-Supervised Learning for Sketch and Handwriting, IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2021.

Vectorization and Rasterization: Self-Supervised Learning for Sketch and Handwriting, CVPR 2021. Ayan Kumar Bhunia, Pinaki nath Chowdhury, Yongxin Yan

Ayan Kumar Bhunia 44 Dec 12, 2022
A curated list of awesome Deep Learning tutorials, projects and communities.

Awesome Deep Learning Table of Contents Books Courses Videos and Lectures Papers Tutorials Researchers Websites Datasets Conferences Frameworks Tools

Christos 20k Jan 05, 2023
Run containerized, rootless applications with podman

Why? restrict scope of file system access run any application without root privileges creates usable "Desktop applications" to integrate into your nor

119 Dec 27, 2022
Efficient Multi Collection Style Transfer Using GAN

Proposed a new model that can make style transfer from single style image, and allow to transfer into multiple different styles in a single model.

Zhaozheng Shen 2 Jan 15, 2022
A toolkit for document-level event extraction, containing some SOTA model implementations

❤️ A Toolkit for Document-level Event Extraction with & without Triggers Hi, there 👋 . Thanks for your stay in this repo. This project aims at buildi

Tong Zhu(朱桐) 159 Dec 22, 2022
Code & Models for Temporal Segment Networks (TSN) in ECCV 2016

Temporal Segment Networks (TSN) We have released MMAction, a full-fledged action understanding toolbox based on PyTorch. It includes implementation fo

1.4k Jan 01, 2023
An OpenAI Gym environment for multi-agent car racing based on Gym's original car racing environment.

Multi-Car Racing Gym Environment This repository contains MultiCarRacing-v0 a multiplayer variant of Gym's original CarRacing-v0 environment. This env

Igor Gilitschenski 56 Nov 01, 2022
Gesture-controlled Video Game. Just swing your finger and play the game without touching your PC

Gesture Controlled Video Game Detailed Blog : https://www.analyticsvidhya.com/blog/2021/06/gesture-controlled-video-game/ Introduction This project is

Devbrat Anuragi 35 Jan 06, 2023
Official repository for "Deep Recurrent Neural Network with Multi-scale Bi-directional Propagation for Video Deblurring".

RNN-MBP Deep Recurrent Neural Network with Multi-scale Bi-directional Propagation for Video Deblurring (AAAI-2022) by Chao Zhu, Hang Dong, Jinshan Pan

SIV-LAB 22 Aug 31, 2022