Python版OpenCVのTracking APIのサンプルです。DaSiamRPNアルゴリズムまで対応しています。

Overview

OpenCV-Object-Tracker-Sample

Python版OpenCVのTracking APIのサンプルです。
 

Requirement

  • opencv-contrib-python 4.5.3.56 or later

Algorithm

2021/07/16時点でOpenCVには以下9アルゴリズムが実装されています。

  • DaSiamRPN
  • MIL
  • GOTURN
  • CSRT
  • KCF
  • Boosting(Legacy API)
  • MOSSE(Legacy API)
  • MedianFlow(Legacy API)
  • TLD(Legacy API)

Usage

DaSiamRPNトラッカーのみのサンプルと、各アルゴリズムを比較するサンプルの2種類を用意しています。

DaSiamRPNトラッカーサンプル

以下コマンドでデモを起動してください。
最初のフレーム表示時にROI選択を行い追跡対象を指定します。
ESCキー押下でプログラム終了、スペースキー押下で追跡対象の再指定を行います。

python DaSiamRPN_sample.py
  • --device
    動画ファイル、もしくはカメラデバイス番号の指定
    デフォルト:"sample_movie/bird.mp4"
  • --width
    カメラキャプチャ時の横幅
    デフォルト:960
  • --height
    カメラキャプチャ時の縦幅
    デフォルト:540

各アルゴリズム比較サンプル

以下コマンドでデモを起動してください。
最初のフレーム表示時にROI選択を行い追跡対象を指定します。
ESCキー押下でプログラム終了、スペースキー押下で追跡対象の再指定を行います。
--use_xxxxを指定することで使用アルゴリズムを追加できます。 ※何も指定していない場合はDaSiamRPNのみで動作

python performance_comparison_sample.py
  • --device
    動画ファイル、もしくはカメラデバイス番号の指定
    デフォルト:"sample_movie/bird.mp4"
  • --width
    カメラキャプチャ時の横幅
    デフォルト:960
  • --height
    カメラキャプチャ時の縦幅
    デフォルト:540
  • --use_mil
    MILトラッカーの使用有無
    デフォルト:指定なし
  • --use_goturn
    GOTURNトラッカーの使用有無 ※model/GOTURN配下のzip要解凍
    デフォルト:指定なし
  • --use_dasiamrpn
    DaSiamRPNトラッカーの使用有無
    デフォルト:指定なし
  • --use_csrt
    CSRTトラッカーの使用有無
    デフォルト:指定なし
  • --use_kcf
    KCFトラッカーの使用有無
    デフォルト:指定なし
  • --use_boosting
    Boostingトラッカーの使用有無
    デフォルト:指定なし
  • --use_mosse
    MOSSEトラッカーの使用有無
    デフォルト:指定なし
  • --use_medianflow
    MedianFlowトラッカーの使用有無
    デフォルト:指定なし
  • --use_tld
    TLDトラッカーの使用有無
    デフォルト:指定なし

ToDo

  • GOTURNトラッカーのモデル読み込みに失敗する問題の調査

Author

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

License

OpenCV-Object-Tracker-Sample is under Apache-2.0 License.

License(Image)

サンプル動画はNHKクリエイティブ・ライブラリーハクセキレイ エサをついばみながら歩くを使用しています。

Owner
KazuhitoTakahashi
KazuhitoTakahashi
Implementation of the GBST block from the Charformer paper, in Pytorch

Charformer - Pytorch Implementation of the GBST (gradient-based subword tokenization) module from the Charformer paper, in Pytorch. The paper proposes

Phil Wang 105 Dec 26, 2022
PyToch implementation of A Novel Self-supervised Learning Task Designed for Anomaly Segmentation

Self-Supervised Anomaly Segmentation Intorduction This is a PyToch implementation of A Novel Self-supervised Learning Task Designed for Anomaly Segmen

WuFan 2 Jan 27, 2022
🍷 Gracefully claim weekly free games and monthly content from Epic Store.

EPIC 免费人 🚀 优雅地领取 Epic 免费游戏 Introduction 👋 Epic AwesomeGamer 帮助玩家优雅地领取 Epic 免费游戏。 使用 「Epic免费人」可以实现如下需求: get:搬空游戏商店,获取所有常驻免费游戏与免费附加内容; claim:领取周免游戏及其免

571 Dec 28, 2022
Virtual hand gesture mouse using a webcam

NonMouse 日本語のREADMEはこちら This is an application that allows you to use your hand itself as a mouse. The program uses a web camera to recognize your han

Yuki Takeyama 55 Jan 01, 2023
Code for the paper A Theoretical Analysis of the Repetition Problem in Text Generation

A Theoretical Analysis of the Repetition Problem in Text Generation This repository share the code for the paper "A Theoretical Analysis of the Repeti

Zihao Fu 37 Nov 21, 2022
An Official Repo of CVPR '20 "MSeg: A Composite Dataset for Multi-Domain Segmentation"

This is the code for the paper: MSeg: A Composite Dataset for Multi-domain Semantic Segmentation (CVPR 2020, Official Repo) [CVPR PDF] [Journal PDF] J

226 Nov 05, 2022
Learning where to learn - Gradient sparsity in meta and continual learning

Learning where to learn - Gradient sparsity in meta and continual learning In this paper, we investigate gradient sparsity found by MAML in various co

Johannes Oswald 28 Dec 09, 2022
A new test set for ImageNet

ImageNetV2 The ImageNetV2 dataset contains new test data for the ImageNet benchmark. This repository provides associated code for assembling and worki

186 Dec 18, 2022
PyTorch implementation of the ACL, 2021 paper Parameter-efficient Multi-task Fine-tuning for Transformers via Shared Hypernetworks.

Parameter-efficient Multi-task Fine-tuning for Transformers via Shared Hypernetworks This repo contains the PyTorch implementation of the ACL, 2021 pa

Rabeeh Karimi Mahabadi 98 Dec 28, 2022
Project page for our ICCV 2021 paper "The Way to my Heart is through Contrastive Learning"

The Way to my Heart is through Contrastive Learning: Remote Photoplethysmography from Unlabelled Video This is the official project page of our ICCV 2

36 Jan 06, 2023
3DV 2021: Synergy between 3DMM and 3D Landmarks for Accurate 3D Facial Geometry

SynergyNet 3DV 2021: Synergy between 3DMM and 3D Landmarks for Accurate 3D Facial Geometry Cho-Ying Wu, Qiangeng Xu, Ulrich Neumann, CGIT Lab at Unive

Cho-Ying Wu 239 Jan 06, 2023
Controlling Hill Climb Racing with Hand Tacking

Controlling Hill Climb Racing with Hand Tacking Opened Palm for Gas Closed Palm for Brake

Rohit Ingole 3 Jan 18, 2022
Algebraic effect handlers in Python

PyEffect: Algebraic effects in Python What IDK. Usage effects.handle(operation, handlers=None) effects.set_handler(effect, handler) Supported effects

Greg Werbin 5 Dec 27, 2021
Domain Adaptation with Invariant RepresentationLearning: What Transformations to Learn?

Domain Adaptation with Invariant RepresentationLearning: What Transformations to Learn? Repository Structure: DSAN |└───amazon |    └── dataset (Amazo

DMIRLAB 17 Jan 04, 2023
Third party Pytorch implement of Image Processing Transformer (Pre-Trained Image Processing Transformer arXiv:2012.00364v2)

ImageProcessingTransformer Third party Pytorch implement of Image Processing Transformer (Pre-Trained Image Processing Transformer arXiv:2012.00364v2)

61 Jan 01, 2023
PyTorch implementation of the R2Plus1D convolution based ResNet architecture described in the paper "A Closer Look at Spatiotemporal Convolutions for Action Recognition"

R2Plus1D-PyTorch PyTorch implementation of the R2Plus1D convolution based ResNet architecture described in the paper "A Closer Look at Spatiotemporal

Irhum Shafkat 342 Dec 16, 2022
Uncertainty Estimation via Response Scaling for Pseudo-mask Noise Mitigation in Weakly-supervised Semantic Segmentation

Uncertainty Estimation via Response Scaling for Pseudo-mask Noise Mitigation in Weakly-supervised Semantic Segmentation Introduction This is a PyTorch

XMed-Lab 30 Sep 23, 2022
Semantic Bottleneck Scene Generation

SB-GAN Semantic Bottleneck Scene Generation Coupling the high-fidelity generation capabilities of label-conditional image synthesis methods with the f

Samaneh Azadi 41 Nov 28, 2022
Look Closer: Bridging Egocentric and Third-Person Views with Transformers for Robotic Manipulation

Look Closer: Bridging Egocentric and Third-Person Views with Transformers for Robotic Manipulation Official PyTorch implementation for the paper Look

Rishabh Jangir 20 Nov 24, 2022
Fast and accurate optimisation for registration with little learningconvexadam

convexAdam Learn2Reg 2021 Submission Fast and accurate optimisation for registration with little learning Excellent results on Learn2Reg 2021 challeng

17 Dec 06, 2022