An end-to-end computer vision project for object detection, multi-object tracking, and motion visualization using YOLOv8 and ByteTrack.
This repository demonstrates how to build a clean, local inference pipeline that goes beyond object detection by adding persistent identities, motion understanding, and trajectory visualization.
This project implements a complete multi-object tracking (MOT) pipeline:
- Fine-tune a YOLOv8 detector on a video-based dataset
- Perform online multi-object tracking using ByteTrack
- Visualize object trajectories and motion dynamics
- Export structured tracking outputs for downstream analysis
The focus is on engineering clarity, reproducibility, and interpretability, rather than UI or cloud deployment.
- Fine-tuned YOLOv8 (Ultralytics)
- Anchor-free, single-stage detector
- Trained on MOT17 (person class)
- ByteTrack for online tracking
- Persistent object IDs across frames
- Robust to occlusions and missed detections
- Per-object trajectories with fading history
- Velocity vectors showing direction and relative speed
- Stable ID visualization across frames
- Annotated video with boxes, IDs, trajectories, and velocity arrows
- Frame-level CSV containing tracking data
This project is designed to reflect real-world computer vision systems, not just model training:
- Clear separation of data, models, scripts, and outputs
- Local inference (no cloud or UI dependencies)
- Modular code that can be extended easily
- Visualizations focused on interpretability
.
├── convert_mot17_to_yolo.py
├── data
│ ├── dataset.yaml
│ ├── images
│ └── labels
├── models
├── outputs
│ ├── tracked_trajectory_velocity.mp4
│ └── tracks.csv
├── README.md
├── requirements.txt
├── runs
│ └── detect
├── track_mot17.py
├── train_yolov8.py
├── yolo11n.pt
└── yolov8n.pt
7 directories, 10 files
Training artifacts under
runs/are generated automatically by Ultralytics and are not part of the final model deliverables.
- MOT17 (Multiple Object Tracking Benchmark)
- Person class only
- Sequence-level train/validation split
The dataset is not included in this repository.
Please download MOT17 separately and update paths in the scripts.
Convert MOT17 annotations to YOLO format:
python scripts/prepare_mot17_for_yolov8.pyThis step:
- Converts MOT annotations to YOLO format
- Ensures bounding boxes are valid and normalized
- Produces a YOLOv8-compatible dataset layout
Fine-tune a pretrained YOLOv8 model:
python scripts/train_yolov8.pyRun detection + tracking with motion visualization:
python scripts/track_mot17.pyThis generates:
- Annotated video with:
- Bounding boxes
- Persistent IDs
- Fading trajectories
- Velocity vectors
- Frame-level CSV output with object positions
- YOLOv8 anchor-free detection
- ByteTrack motion-based association
- Trajectory history visualization
- Velocity estimation from motion
- Clean, modular Python implementation