A plug-and-play multi-object tracking (MOT) Python library offering modular implementations of classic algorithms like SORT and ByteTrack. Features a detector-agnostic design compatible with any object detection model (YOLO, DETR, etc.), supporting video files, cameras, RTSP streams, and more. Provides unified CLI tools and Python API with built-in evaluation metrics (CLEAR, HOTA, Identity).
Overview#
Roboflow Trackers is a multi-object tracking (MOT) toolkit by Roboflow, designed to decouple tracking logic from detection models. By providing clean, modular algorithm re-implementations, it addresses the fragmentation and integration complexity of tracking algorithms.
Core Algorithms#
Currently Supported#
- SORT: Simple Online and Realtime Tracking - classic real-time tracking based on Kalman filtering and Hungarian algorithm
- ByteTrack: Advanced algorithm leveraging low-confidence detection boxes to improve tracking under occlusion
Planned Support#
- OC-SORT, BoT-SORT, McByte (marked as Coming soon on official site)
Features#
Input Sources#
- Video files (.mp4, .avi)
- Camera index
- RTSP streams
- Image directories
Visualization Output#
Supports drawing bounding boxes, masks, trajectories, IDs, confidence scores, labels, and more. Output as annotated video files or real-time preview.
Evaluation Capabilities#
Compute standard MOT metrics against ground truth:
- CLEAR metrics
- HOTA (Higher Order Tracking Accuracy)
- Identity-related metrics
Installation#
# Basic installation (tracking only)
pip install trackers
# Full installation (with Roboflow inference models)
pip install trackers[detection]
Requirements: Python >= 3.10
Quick Start#
CLI Usage#
# Process video with default settings
trackers track --source video.mp4 --output output.mp4
# Specify model and tracker
trackers track --source video.mp4 --output output.mp4 \
--model rfdetr-medium \
--tracker bytetrack \
--show-trajectories
# Evaluate tracking results
trackers eval --gt-dir data/gt --tracker-dir data/trackers --metrics CLEAR HOTA Identity
Python API#
import cv2
import supervision as sv
from inference import get_model
from trackers import ByteTrackTracker
model = get_model("yolov8n-640")
tracker = ByteTrackTracker()
for frame in video_frames:
result = model.infer(frame)[0]
detections = sv.Detections.from_inference(result)
tracked_detections = tracker.update(detections)
# tracked_detections now contains tracker_id
Key Configuration Parameters#
Tracker Parameters#
| Parameter | Default | Description |
|---|---|---|
--tracker | bytetrack | Algorithm selection (bytetrack/sort) |
lost_track_buffer | 30 | Frame buffer for lost tracks, improves occlusion robustness |
track_activation_threshold | 0.25 | Confidence threshold to activate new tracks |
minimum_consecutive_frames | 3 | Consecutive detections required to confirm track |
minimum_iou_threshold | 0.3 | Minimum IoU for detection-track matching |
Detector Parameters#
| Parameter | Description |
|---|---|
--model | Model name (rfdetr-nano/small/medium/large) |
model.confidence | Detection confidence threshold (default 0.5) |
model.device | Device selection (auto/cpu/cuda/mps) |
Architecture#
trackers/
├── core/ # Core algorithm implementations
│ ├── base.py # Base class definition
│ ├── bytetrack/ # ByteTrack implementation
│ └── sort/ # SORT implementation
├── eval/ # Evaluation logic
├── scripts/ # CLI entry point
├── annotators/ # Visualization tools
├── io/ # I/O handling
├── motion/ # Motion models
└── utils/ # Utility functions
Design Highlights:
- Detector-agnostic: Core interface
tracker.update(detections)accepts standardized detection objects - Deep integration with supervision ecosystem, fully compatible data structures
- Flexible CLI parameter parsing via jsonargparse
Use Cases#
- Real-time object tracking in video streams (surveillance, security)
- Sports event or behavior analysis (SoccerNet, SportsMOT datasets)
- Computer vision pipelines requiring consistent target ID maintenance
- Research tasks comparing different MOT algorithm performance