KCFpy
Python implementation of KCF tracking algorithm
Install / Use
/learn @uoip/KCFpyREADME
KCF tracker in Python
Python implementation of
High-Speed Tracking with Kernelized Correlation Filters<br> J. F. Henriques, R. Caseiro, P. Martins, J. Batista<br> TPAMI 2015
It is translated from KCFcpp (Authors: Joao Faro, Christian Bailer, Joao F. Henriques), a C++ implementation of Kernelized Correlation Filters. Find more references and code of KCF at http://www.robots.ox.ac.uk/~joao/circulant/
Requirements
- Python 2.7
- NumPy
- Numba (needed if you want to use the hog feature)
- OpenCV (ensure that you can
import cv2in python)
Actually, I have installed Anaconda(for Python 2.7), and OpenCV 3.1(from opencv.org).
Use
Download the sources and execute
git clone https://github.com/uoip/KCFpy.git
cd KCFpy
python run.py
It will open the default camera of your computer, you can also open a different camera or a video
python run.py 2
python run.py ./test.avi
Try different options (hog/gray, fixed/flexible window, singlescale/multiscale) of KCF tracker by modifying the arguments in line tracker = kcftracker.KCFTracker(False, True, False) # hog, fixed_window, multiscale in run.py.
Peoblem
I have struggled to make this python implementation as fast as possible, but it's still 2 ~ 3 times slower than its C++ counterpart, furthermore, the use of Numba introduce some unpleasant delay when initializing tracker (NEW: the problem has been solved in KCFnb by using AOT compilation).
NEWER: I write a python wrapper for KCFcpp, see KCFcpp-py-wrapper, so we can benefit from C++'s speed in python now.
Related Skills
node-connect
347.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
