Traff-IQ
Adaptive Traffic Management
Role
Full Stack AI Engineer
Timeline
4 Months
Technologies




Overview
A real-time AI and spatial mapping system that intelligently monitors urban traffic signals, detects congestion density, and maps emergency vehicle routes using YOLOv8.
The Problem
Traditional traffic light systems are completely static, leading to catastrophic delays for emergency vehicles (ambulances, fire engines). The system needed to detect these vehicles via live camera feeds and dynamically prioritize their routes across city intersections in real-time.
Live Metrics
Latency
< 200ms
Mapping
Leaflet
Comm
WebSockets
import cv2
import socketio
sio = socketio.Client()
sio.connect('ws://traffic-relay.local')
def process_intersection_feed():
model = YOLO("yolov8n.pt")
cap = cv2.VideoCapture("rtsp://camera-01")
while cap.isOpened():
success, frame = cap.read()
results = model(frame)
for r in results:
if "ambulance" in r.names:
# Bypass normal event loop for latency
sio.emit("override_signal", {"node": "A14", "state": "GREEN"})
process_intersection_feed()Architecture & Design
Spatial Mapping
Integrated Leaflet via react-leaflet instead of Google Maps to enable rapid, free dynamic marker updates for moving emergency vehicles.
Route Generation
Utilized the OpenRouteService API rather than Mapbox to generate geoJSON paths dynamically without hitting aggressive API rate limits.
Client_Node
Frontend + WebSocket
Inference_Core
Python Engine + YOLOv8 Map
Outcomes
Maintained sub-200ms websocket latency during peak loads of 50+ concurrent vehicle tracking events.
Rendered 10,000+ dynamic geoJSON spatial markers simultaneously with 0 UI thread blocking.
Trained YOLOv8 model to 94.2% mAP, detecting ambulances at 30 FPS on edge hardware.