An easy-to-use library for implementing various multi-object tracking algorithms.
Project description
supertracker
An easy-to-use library for implementing various multi-object tracking algorithms.
Features
- Simple and intuitive interface for multi-object tracking
- Multiple tracking algorithms supported:
- ByteTrack
- DeepSORT (coming soon)
- SORT (coming soon)
- OCSORT (coming soon)
- BoT-SORT (coming soon)
- Support for custom detection formats
- Easy integration with existing detection pipelines
- Modular design for adding new trackers
Installation
pip install supertracker
Examples
import cv2
from ultralytics import YOLO
from supertracker import ByteTrack
from supertracker import Detections
# Initialize YOLO model and tracker
model = YOLO('yolov8n.pt') # or your custom model
tracker = ByteTrack(
track_activation_threshold=0.25,
lost_track_buffer=30,
frame_rate=30
)
# Initialize video capture
cap = cv2.VideoCapture(0) # or video file path
while True:
ret, frame = cap.read()
if not ret:
break
# Run YOLO detection
results = model(frame)[0]
# Convert YOLO results to Detections format
detections = Detections(
xyxy=results.boxes.xyxy.cpu().numpy(),
confidence=results.boxes.conf.cpu().numpy(),
class_id=results.boxes.cls.cpu().numpy().astype(int)
)
# Update tracker
tracked_objects = tracker.update_with_detections(detections)
# Visualize results
for i in range(len(tracked_objects)):
box = tracked_objects.xyxy[i].astype(int)
track_id = tracked_objects.tracker_id[i]
class_id = tracked_objects.class_id[i]
conf = tracked_objects.confidence[i]
# Draw bounding box
cv2.rectangle(frame, (box[0], box[1]), (box[2], box[3]), (0, 255, 0), 2)
# Draw label with class name, track ID and confidence
label = f"#{track_id} {model.names[class_id]} {conf:.2f}"
cv2.putText(frame, label, (box[0], box[1] - 10),
cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 255, 0), 2)
cv2.imshow("Tracking", frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
Documentation
Visit our documentation for more details
Contributing
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file supertracker-0.2.0.tar.gz.
File metadata
- Download URL: supertracker-0.2.0.tar.gz
- Upload date:
- Size: 7.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a924b2a1223c1350b2af7da0d5bace77a90ffcfe3e4dceb3f0c649b2d4c0bbbf
|
|
| MD5 |
0d55492f8478723d8947e87cf4f19168
|
|
| BLAKE2b-256 |
3237e0033ddac12dd9e0114690758870370e88355d34b0aa87c5f4ef39e595b4
|
File details
Details for the file supertracker-0.2.0-py2.py3-none-any.whl.
File metadata
- Download URL: supertracker-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfd039741d2731e6bec0a18bf0e1c65197263a1b2b717b61754cce428d865008
|
|
| MD5 |
11c3acbafff3df7e429a92674aca8f54
|
|
| BLAKE2b-256 |
74db571cf506e2515b6a228d3ea1fa4be22aede9ba6936ece4c927333bff42b4
|