Skip to content

leandroL1337/smartsemaphore

Repository files navigation

smartsemaphore

Smart Semaphore using Machine Learning

AI-powered traffic management system with emergency vehicle detection, adaptive timing, and vulnerable user protection.

🚀 Quick Start

Prerequisites

Python 3.8+

Installation

  1. Clone the repository
git clone https://github.com/leandroL1337/smartsemaphore.git
git lfs pull
cd smartsemaphore
  1. Install dependencies
pip install ultralytics opencv-python numpy torch
  1. Download models (auto-downloaded on first run)
  • YOLOv8 detection model: yolov8n.pt
  • Emergency classifier: runs/classify/emergency_vehicle_classifier/weights/best.pt (included)

Usage

Run the system:

python smartsemaphore.py

For 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

About

Smart Semaphore using Machine Learning

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages