An AI-powered smart traffic management system that leverages YOLOv8 for real-time vehicle detection and LSTM neural networks for traffic flow prediction. The system dynamically controls traffic signals, prioritizes emergency vehicles, and provides a live visualization dashboard.
- 🔍 Real-time vehicle detection using YOLOv8
- 🚨 Emergency vehicle recognition and priority control
- 📈 Traffic congestion prediction using LSTM neural networks
- 🟢 Adaptive traffic signal control
- Dynamic green light extension
- Idle time reduction
- Emergency override logic
- 📊 Live dashboard visualization
- Vehicle counts
- Traffic decisions
- Real-time updates
- 🎥 Supports video files and live camera feeds
| Layer | Tools / Libraries |
|---|---|
| Object Detection | YOLOv8 (Ultralytics) |
| Video Processing | OpenCV |
| Prediction Model | TensorFlow / Keras (LSTM) |
| Dashboard UI | Plotly Dash |
| Backend Logic | Python (Multithreading) |
-
Video Input
Captures real-time video from a camera or video file using OpenCV -
Vehicle Detection
YOLOv8 detects cars, buses, bikes, and emergency vehicles -
Traffic Prediction
LSTM model predicts congestion levels based on vehicle density -
Decision Engine
Adjusts traffic signal timing dynamically and prioritizes emergency vehicles -
Live Dashboard
Displays vehicle count and traffic decisions with periodic updates
git clone https://github.com/prattyan/traffic-manage
cd traffic-managepip install -r requirements.txt- Add a sample video named
traffic_video.mp4
OR - Connect a live camera feed
YOLOv8 model weights are automatically downloaded via Ultralytics.
python app.py📂 traffic-monitoring-system/
│
├── traffic_video.mp4 # Sample traffic footage
├── traffic_lstm.h5 # Pre-trained LSTM model
├── yolov8n.pt # YOLOv8 nano weights
├── app.py # Main application script
├── requirements.txt # Dependencies
└── README.md # Project documentation
- 📡 Integration of multiple camera feeds
- 🗄️ Storage of historical traffic data
- 📢 Real-time alerts to traffic authorities
- ☁️ Cloud deployment for large-scale use
- 🧠 Reinforcement learning for smarter signal optimization
Prattyan Ghosh
📧 Email: prattyanghosh@gmail.com
🔗 LinkedIn | Portfolio
⭐ If you find this project useful, consider giving it a star!
