A real-time object detection and tracking system built with YOLOv8 and OpenCV. Detects 80+ object classes from a webcam or video file, assigns persistent tracking IDs, and displays results with a clean HUD overlay.
- 🎯 Real-time detection of 80+ object classes using YOLOv8
- 🔢 Persistent object tracking with unique IDs (ByteTrack)
- 🌈 Color-coded bounding boxes per tracking ID
- 📊 Live FPS counter and object count HUD
- 📸 Screenshot capture (press S)
- ⏸️ Pause / Resume (press P)
- 📁 Works with webcam or any video file
| Tool | Purpose |
|---|---|
YOLOv8 (ultralytics) |
Pre-trained object detection model |
OpenCV |
Video capture, frame processing & display |
ByteTrack |
Object tracking algorithm (built into ultralytics) |
Python 3.8+ |
Core language |
- Video frames are captured from webcam or file using OpenCV
- Each frame is passed through YOLOv8n (nano) for fast object detection
- ByteTrack assigns consistent tracking IDs across frames
- Bounding boxes, labels, confidence scores, and track IDs are drawn
- A HUD overlay shows FPS, object count, and controls
git clone https://github.com/fsafva13-coder/CodeAlpha_ObjectDetection
cd CodeAlpha_ObjectDetectionpip install -r requirements.txtpython app.pypython app.py --source video.mp4| Key | Action |
|---|---|
Q |
Quit the application |
S |
Save screenshot to /screenshots folder |
P |
Pause / Resume |
CodeAlpha_ObjectDetection/
│
├── app.py # Main detection & tracking script
├── requirements.txt # Python dependencies
├── screenshots/ # Saved screenshots (auto-created)
└── README.md # Project documentation
📹 Full demo video available on LinkedIn
📂 GitHub: CodeAlpha_ObjectDetection
Fathima Safva — CodeAlpha AI Intern GitHub: @fsafva13-coder LinkedIn: Fathima Safva
This project is built as part of the CodeAlpha AI Internship Program. Website: www.codealpha.tech


