An AI-powered real-time vehicle detection and classification system designed specifically for Lagos, Nigeria roads. Detects and classifies Lagos-specific vehicle types including Okada, Danfo, BRT, Keke Napep, and more.
# π¦ Lagos Traffic Analysis System
An AI-powered real-time vehicle detection and classification system designed specifically for Lagos, Nigeria roads. Detects and classifies Lagos-specific vehicle types including Okada, Danfo, BRT, Keke Napep, and more.
## π― Features
- **Real-time Vehicle Detection** - Live video stream processing with YOLOv8
- **Lagos-Specific Classification** - Identifies local vehicle types:
- ποΈ Okada (Motorcycles)
- π Danfo (Yellow Minibuses)
- π BRT (Blue Rapid Transit Buses)
- πΊ Keke Napep (Yellow Tricycles)
- π Other Buses
- π Trucks
- π Private Cars
- **Unique Vehicle Counting** - IoU-based tracking counts each vehicle once
- **Professional Web Dashboard** - Modern UI with Tailwind CSS
- **Real-time Analytics** - Live charts and statistics
- **Database Logging** - SQLite storage for historical analysis
## πΌοΈ Screenshots
*Add your screenshots here*
## π οΈ Tech Stack
- **Detection**: YOLOv8 (Ultralytics)
- **Backend**: FastAPI + Uvicorn
- **Video Processing**: OpenCV
- **Database**: SQLite
- **Frontend**: HTML5 + Tailwind CSS + Chart.js
- **Real-time Updates**: WebSocket
## π Project Structure
```
lagos_traffic/
βββ config.py # Configuration settings
βββ main.py # Main orchestration script
βββ requirements.txt # Python dependencies
βββ modules/
β βββ detector.py # Vehicle detection & classification
β βββ tracker.py # IoU-based vehicle tracking
β βββ camera.py # Video/camera handling
β βββ database.py # SQLite database operations
βββ dashboard/
β βββ app.py # FastAPI backend
β βββ templates/
β β βββ index.html # Web dashboard UI
β βββ static/ # Static assets
βββ test_videos/ # Place test videos here
βββ database/ # SQLite database storage
βββ logs/ # Application logs
```
## π Getting Started
### Prerequisites
- Python 3.9+
- pip
### Installation
1. **Clone the repository**
```bas β¦