[!IMPORTANT] This project is currently under active development. APIs and features are subject to change.
Trackforge is a unified, high-performance computer vision tracking library, implemented in Rust and exposed as a Python package. It provides state-of-the-art tracking algorithms like ByteTrack, optimized for speed and ease of use in both Rust and Python environments.
Features
- 🚀 High Performance: Native Rust implementation for maximum speed and memory safety.
- 🐍 Python Bindings: Seamless integration with the Python ecosystem using
pyo3. - 🛠 Unified API: Consistent interface for tracking tasks across both languages.
- 📸 ByteTrack: Robust multi-object tracking using Kalman filters and IoU matching.
Roadmap
TODO — Multi-Object Tracking (MOT)
Core Trackers
- SORT — Simple Online and Realtime Tracking
- Norfair — Lightweight distance-based tracking
Appearance-Based (Re-ID)
- DeepSORT — SORT + appearance embeddings
- StrongSORT — Improved DeepSORT with stronger Re-ID
- StrongSORT++ — StrongSORT with camera motion compensation
Detection-Driven Trackers
- ByteTrack — High/low confidence detection association
- BoT-SORT — ByteTrack + Re-ID + camera motion compensation
Joint Detection & Tracking
- FairMOT — Unified detection and Re-ID network
- CenterTrack — Motion-aware detection-based tracking
Transformer-Based Trackers
- OC-SORT — Observation-centric SORT
- TrackFormer — Transformer-based MOT
- MOTR — End-to-end transformer tracking
GPU Support & Architecture
Trackforge transforms detections into tracks. It is designed to be the high-speed CPU "glue" in your pipeline.
- Detectors (GPU): Your object detector (YOLOv8, Yolanas, etc.) runs on the GPU to produce bounding boxes.
- Trackforge (CPU): Receives these boxes and associates them on the CPU. Algorithms like ByteTrack are extremely efficient (less than 1ms per frame) and do not typically strictly require GPU acceleration, avoiding complex device transfers for the association step.
- Future: We may explore GPU-based association for massive-scale batch processing if data is already on-device.
Installation
Python
Rust
Add trackforge to your Cargo.toml:
[]
= "0.1.6" # Check crates.io for latest version
Usage
🐍 Python
ByteTrack
# (tlwh, score, class_id)
=
=
=
DeepSORT
DeepSORT requires appearance embeddings (re-id features) alongside detection boxes.
# detections: [(tlwh, score, class_id), ...]
=
# embeddings: List of feature vectors (float32 list) corresponding to detections
= # Example embedding vector
=
=
# output adds confidence: (track_id, tlwh, confidence, class_id)
See examples/python/deepsort_demo.py for a full example using ultralytics YOLO and torchvision ResNet.
🦀 Rust
ByteTrack
use ByteTrack;
DeepSORT
See examples/deepsort_ort.rs for a full example integrating with ort (ONNX Runtime) for Re-ID and usls for detection.
// Minimal setup
use DeepSort;
use AppearanceExtractor;
;
let extractor = MyExtractor;
let mut tracker = new;
Development
This project uses maturin to manage the Rust/Python interop.
Prerequisites
- Rust & Cargo
- Python 3.8+
maturin:pip install maturin
Build
# Build Python bindings
# Run Rust tests
Contributing
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.