Skip to content

About

This project detects, tracks, and re-identifies objects across frames using persistent track IDs. It also visualizes motion trails, track memory, FPS, and dynamic class filtering.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

๐ŸŽฏ Re-Identification Tracker (YOLOv8 + ByteTrack)

Real-time multi-object tracking with automatic re-identification using YOLOv8 and built-in ByteTrack.

This project detects, tracks, and re-identifies objects across frames using persistent track IDs. It also visualizes motion trails, track memory, FPS, and dynamic class filtering.

๐Ÿš€ Features

  • โœ… Real-time object detection
  • โœ… Persistent ID tracking (ByteTrack)
  • โœ… Re-identification detection (gap-based)
  • โœ… Motion trail visualization
  • โœ… Live FPS counter
  • โœ… Class filtering (All / Person / Car)
  • โœ… Mirror toggle
  • โœ… Clean HUD overlay

๐Ÿง  Architecture

This tracker is powered by:

  • YOLOv8 for object detection

  • ByteTrack for ID persistence

  • Custom logic for:

    • Re-ID gap detection
    • Track memory expiration
    • Motion history trails

Pipeline:

Camera Frame
    โ†“
YOLOv8 Detection
    โ†“
ByteTrack ID Assignment
    โ†“
Re-ID Logic (Gap + Timeout)
    โ†“
Rendering (Boxes + Trails + HUD)

๐Ÿ“ฆ Installation

Only one requirement:

pip install ultralytics

Other dependencies:

  • Python 3.10+
  • OpenCV
  • NumPy

If OpenCV is not installed:

pip install opencv-python numpy

โ–ถ๏ธ Run

python tracker.py

On first run, the YOLOv8 model (yolov8n.pt) will auto-download (~6MB).

๐ŸŽฎ Controls

Key Action
F Cycle class filter (All โ†’ Person โ†’ Car)
M Toggle mirror
H Toggle help overlay
Q Quit

โš™๏ธ Configurable Parameters

Inside the script:

YOLO_MODEL   = "yolov8n.pt"
CONFIDENCE   = 0.4
TRAIL_LEN    = 40
REID_TIMEOUT = 10.0
REID_GAP     = 1.5

Meaning

  • CONFIDENCE โ†’ Detection threshold
  • TRAIL_LEN โ†’ Length of motion trail
  • REID_TIMEOUT โ†’ How long memory keeps lost objects
  • REID_GAP โ†’ Time absence required to flag as "RE-ID"

๐Ÿงฉ Re-Identification Logic

An object is marked as RE-ID if:

  1. It was seen before
  2. It disappeared
  3. It reappears after REID_GAP seconds
  4. It has not expired from memory (REID_TIMEOUT)

This simulates practical re-identification behavior in surveillance and tracking systems.

๐Ÿ“Š Output Visualization

  • Unique color per track ID
  • Bounding box + ID label
  • "RE-ID" badge for reappeared objects
  • Smooth motion trails
  • Live performance metrics

๐Ÿ—๏ธ Why This Project Matters

This implementation demonstrates:

  • Understanding of multi-object tracking
  • State persistence across frames
  • Temporal reasoning
  • Real-time performance handling
  • Computer vision visualization techniques

This is not just detection โ€” it's temporal intelligence over video streams.

๐Ÿ”ฎ Future Improvements

  • Deep feature-based Re-ID embeddings
  • Multi-camera support
  • Kalman-based smoothing visualization
  • Save tracking logs to CSV
  • Export annotated video
  • Integrate DeepSORT alternative

๐Ÿง  Learning Context

Part of my structured Computer Vision exploration journey โ€” building systems from detection to intelligent tracking.

About

This project detects, tracks, and re-identifies objects across frames using persistent track IDs. It also visualizes motion trails, track memory, FPS, and dynamic class filtering.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages