Skip to main content

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:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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

supertracker-0.1.0.tar.gz (7.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

supertracker-0.1.0-py2.py3-none-any.whl (14.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file supertracker-0.1.0.tar.gz.

File metadata

  • Download URL: supertracker-0.1.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

Hashes for supertracker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 875dfb267f2938c5a42b993fd835e12654c39c552058965fe89d4929ae16b271
MD5 ef63d822b02dfd68353a0ad3ae9c074d
BLAKE2b-256 cc7a26db069eb8881533d5eb239d6880b148664498405d26e219fd20357d4682

See more details on using hashes here.

File details

Details for the file supertracker-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: supertracker-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for supertracker-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c2ef7568c07d346bdc1a9d630b5d86a06d1184e8648d38a5c676b305fc26c7ef
MD5 ede781ab041a372e53cf6c8c5b578fb8
BLAKE2b-256 4c213432d53b129517e301dc78ddeb2040dce9db4cf134c91b2e77bf39db924e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page