Smart Semaphore using Machine Learning
AI-powered traffic management system with emergency vehicle detection, adaptive timing, and vulnerable user protection.
Python 3.8+- Clone the repository
git clone https://github.com/leandroL1337/smartsemaphore.git
git lfs pull
cd smartsemaphore- Install dependencies
pip install ultralytics opencv-python numpy torch- Download models (auto-downloaded on first run)
- YOLOv8 detection model:
yolov8n.pt - Emergency classifier:
runs/classify/emergency_vehicle_classifier/weights/best.pt(included)
Run the system:
python smartsemaphore.pyFor webcam input:
Edit line 1764 in smartsemaphore.py:
cap = cv2.VideoCapture(0) # Change from video file to webcam / Or keep the same video.Controls:
ESC- Exit system- Debug output appears in console