A real-time AI system that detects ambulances in traffic and automatically controls traffic lights to give emergency vehicles priority passage.
- Real-time Detection: Uses YOLOv8 to identify ambulances, buses, cars, motorcycles, and trucks
- Smart Traffic Control: Automatically switches traffic lights to green when ambulances are detected
- Multi-format Support: Processes both images (JPG, PNG) and videos (MP4, AVI, MOV)
- Web Interface: Easy-to-use Streamlit application with drag-and-drop file upload
-
Install Dependencies
pip install streamlit opencv-python ultralytics pillow numpy
-
Run the Application
streamlit run App.py
-
Upload Media
- Drag and drop images or videos into the web interface
- Watch real-time ambulance detection with traffic light simulation
- Green Light: Activated automatically when ambulance is detected
- Red Light: Default state for normal traffic
- Visual Feedback: Bounding boxes around detected vehicles with labels
- Status Updates: Real-time detection notifications
- Classes: 5 vehicles (Ambulance, Bus, Car, Motorcycle, Truck)
- Training: 100 epochs with YOLOv8
- Accuracy: 60.77% precision, 48.10% recall, 49.29% mAP50
Designed to improve emergency response times by automatically managing traffic signals, potentially saving lives through faster ambulance passage through intersections.