Skip to main content
03 // Real-Time Computer VisionSIH 2026 Finalist • Live

RoadGuard AI

Real-time pothole detection, severity assessment, and automated maintenance reporting platform built with YOLOv11, ByteTrack, FastAPI WebSockets, and Next.js—engineered for sub-second live inference on scale-to-zero serverless CPU.

RoleTeam Lead & Full-Stack AI Architect
ContextSmart India Hackathon (SIH) 2026 • Live
Live DemoSource Code
CPU Latency
< 1s Live
WSS Stream
~15 FPS
Cloud Infra
Scale-to-Zero
INTERACTIVE SYSTEM SIMULATORLIVE CLIENT DEMO
YOLOv11 + BYTETRACK
< 1s CPU~15 FPS WSS
TAP BOX TO INSPECT
TRK-01|CRITICAL|imgsz=416 · Q55|ZEROBUFFER GRABBER
SUPABASE + PDF SMTP
01 // THE BOTTLENECK

Problem Space

Municipal road inspections are manual and reactive, while standard sequential cv2.VideoCapture loops suffer 60s+ MJPEG/FFmpeg buffer lag when camera streams outpace CPU inference.

02 // THE SYSTEM

Production Architecture

Decouples camera ingestion from YOLO inference inside a 2-thread FastAPI WebSocket backend on Azure Container Apps, pairing persistent ByteTrack pothole IDs with Supabase persistence, Leaflet geotagging, and automated PDF maintenance reports.

Execution Pipeline

  1. STAGE 01

    ZeroBufferFrameGrabber

    Auto-switches HTTP IP webcams to persistent /shot.jpg keep-alive polling and drains stale RTSP/FFmpeg buffers (nobuffer, low_delay, BUFFERSIZE=1).

  2. STAGE 02

    Decoupled Async YOLO Worker

    Background worker grabs only the latest frame (640px max width) and runs YOLOv11 + ByteTrack (imgsz=416) behind an INFERENCE_SEMAPHORE.

  3. STAGE 03

    Live ~15 FPS WSS Broadcast

    Streams freshest JPEG frames (Q55) over WebSockets with resolution-independent normalized boxes and persistent track IDs to prevent double-counting.

  4. STAGE 04

    Cost Estimation & PDF Dispatch

    Classifies Critical/High/Medium severity, estimates repair cost, stores sharp context crops in Supabase, and emails compiled PDF reports via Gmail SMTP.

Key Engineering Trade-Offs & Decisions

  • Eliminated 60s+ stream lag on serverless CPU by isolating frame capture from asynchronous model inference.
  • Hardened production against SSRF (ALLOW_PRIVATE_CAM_IPS=false, ALLOW_LOCAL_CAM=false), supporting mobile IP webcams via Cloudflare Quick Tunnel or native browser camera.
  • Enforced strict Content-Security-Policy whitelisting exact Azure ACA https/wss, Supabase, and OpenStreetMap origins in vercel.json.
  • Deployed on Azure Container Apps (Central India, 2 vCPU / 4 GiB, min-replicas: 0) via GHCR for zero idle cost.

Tech Stack

YOLOv11ByteTrackFastAPIWebSocketsNext.jsTypeScriptOpenCVLeafletSupabaseAzure ACA
Deployment & Runtime

Live at road-guard-ai-lake.vercel.app; FastAPI + YOLOv11 container (ghcr.io/tusharsingh-sde/roadguard-backend:v2) running scale-to-zero on Azure Container Apps.

Open-source repo: PRs, issues, and feature collabs are always welcome on GitHub.