Computer Vision & Embedded · 2026
Smart Traffic Flow Analyzer
Traffic signals that adapt to live vehicle density using YOLOv8 and ESP32
A real-time traffic signal system that counts vehicles with YOLOv8 and SORT and changes green-light timing on the fly based on traffic density, with an ESP32 driving the signal display.
Conventional traffic signals run on fixed timing plans that ignore real-time traffic. That wastes green time when roads are empty and causes congestion when they are full.
This system detects and tracks vehicles in a region of interest, averages density over a 5-second sliding window and adjusts the remaining green phase, within safe minimum and maximum bounds.
What it does
- Vehicle detection and tracking with YOLOv8 and SORT
- Dynamic green time from a 5-second sliding average of vehicle density
- Safety constraints keep green time within a configured range (for example 30–90 seconds)
- Signal phase and countdown sent to an ESP32 over TCP for physical LEDs
Built with
- Python
- YOLOv8
- OpenCV
- SORT
- ESP32
- TCP