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
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
Logistic Bandit experiments. Official code for the paper "Jointly Efficient and Optimal Algorithms for Logistic Bandits".

Code for the paper Jointly Efficient and Optimal Algorithms for Logistic Bandits, by Louis Faury, Marc Abeille, Clément Calauzènes and Kwang-Sun Jun.

Faury Louis 1 Jan 22, 2022
Deep Reinforced Attention Regression for Partial Sketch Based Image Retrieval.

DARP-SBIR Intro This repository contains the source code implementation for ICDM submission paper Deep Reinforced Attention Regression for Partial Ske

2 Jan 09, 2022
Code accompanying the NeurIPS 2021 paper "Generating High-Quality Explanations for Navigation in Partially-Revealed Environments"

Generating High-Quality Explanations for Navigation in Partially-Revealed Environments This work presents an approach to explainable navigation under

RAIL Group @ George Mason University 1 Oct 28, 2022
Code release for Local Light Field Fusion at SIGGRAPH 2019

Local Light Field Fusion Project | Video | Paper Tensorflow implementation for novel view synthesis from sparse input images. Local Light Field Fusion

1.1k Dec 27, 2022
Scalable Optical Flow-based Image Montaging and Alignment

SOFIMA SOFIMA (Scalable Optical Flow-based Image Montaging and Alignment) is a tool for stitching, aligning and warping large 2d, 3d and 4d microscopy

Google Research 16 Dec 21, 2022
Code to generate datasets used in "How Useful is Self-Supervised Pretraining for Visual Tasks?"

Synthetic dataset rendering Framework for producing the synthetic datasets used in: How Useful is Self-Supervised Pretraining for Visual Tasks? Alejan

Princeton Vision & Learning Lab 21 Apr 29, 2022
Official PyTorch code of DeepPanoContext: Panoramic 3D Scene Understanding with Holistic Scene Context Graph and Relation-based Optimization (ICCV 2021 Oral).

DeepPanoContext (DPC) [Project Page (with interactive results)][Paper] DeepPanoContext: Panoramic 3D Scene Understanding with Holistic Scene Context G

Cheng Zhang 66 Nov 16, 2022
IDM: An Intermediate Domain Module for Domain Adaptive Person Re-ID,

Intermediate Domain Module (IDM) This repository is the official implementation for IDM: An Intermediate Domain Module for Domain Adaptive Person Re-I

Yongxing Dai 87 Nov 22, 2022
Python codes for Lite Audio-Visual Speech Enhancement.

Lite Audio-Visual Speech Enhancement (Interspeech 2020) Introduction This is the PyTorch implementation of Lite Audio-Visual Speech Enhancement (LAVSE

Shang-Yi Chuang 85 Dec 01, 2022
This repository contains an implementation of the Permutohedral Attention Module in Pytorch

Permutohedral_attention_module This repository contains an implementation of the Permutohedral Attention Module

Samuel JOUTARD 26 Nov 27, 2022
Methods to get the probability of a changepoint in a time series.

Bayesian Changepoint Detection Methods to get the probability of a changepoint in a time series. Both online and offline methods are available. Read t

Johannes Kulick 554 Dec 30, 2022
SalFBNet: Learning Pseudo-Saliency Distribution via Feedback Convolutional Networks

SalFBNet This repository includes Pytorch implementation for the following paper: SalFBNet: Learning Pseudo-Saliency Distribution via Feedback Convolu

12 Aug 12, 2022
FaceAPI: AI-powered Face Detection & Rotation Tracking, Face Description & Recognition, Age & Gender & Emotion Prediction for Browser and NodeJS using TensorFlow/JS

FaceAPI AI-powered Face Detection & Rotation Tracking, Face Description & Recognition, Age & Gender & Emotion Prediction for Browser and NodeJS using

Vladimir Mandic 395 Dec 29, 2022
Implement object segmentation on images using HOG algorithm proposed in CVPR 2005

HOG Algorithm Implementation Description HOG (Histograms of Oriented Gradients) Algorithm is an algorithm aiming to realize object segmentation (edge

Leo Hsieh 2 Mar 12, 2022
Official pytorch implementation of the IrwGAN for unaligned image-to-image translation

IrwGAN (ICCV2021) Unaligned Image-to-Image Translation by Learning to Reweight [Update] 12/15/2021 All dataset are released, trained models and genera

37 Nov 09, 2022
PyTorch implementation of Convolutional Neural Fabrics http://arxiv.org/abs/1606.02492

PyTorch implementation of Convolutional Neural Fabrics arxiv:1606.02492 There are some minor differences: The raw image is first convolved, to obtain

Anuvabh Dutt 25 Dec 22, 2021
Keeping it safe - AI Based COVID-19 Tracker using Deep Learning and facial recognition

Keeping it safe - AI Based COVID-19 Tracker using Deep Learning and facial recognition

Vansh Wassan 15 Jun 17, 2021
A-SDF: Learning Disentangled Signed Distance Functions for Articulated Shape Representation (ICCV 2021)

A-SDF: Learning Disentangled Signed Distance Functions for Articulated Shape Representation (ICCV 2021) This repository contains the official implemen

81 Dec 14, 2022
An implementation of the "Attention is all you need" paper without extra bells and whistles, or difficult syntax

Simple Transformer An implementation of the "Attention is all you need" paper without extra bells and whistles, or difficult syntax. Note: The only ex

29 Jun 16, 2022