A Zero-Shot Advanced Driver Assistance System (ADAS) heuristic baseline for real-time highway infrastructure analysis.
Engineered for the National Highways Authority of India (NHAI) Innovation Hackathon, RetroVision AI replaces dangerous, manual hand-held retroreflectivity spot-checks with a fully automated, software-only pipeline. It extracts highly accurate luminance data from standard, uncalibrated vehicle dashcams at highway speeds across day, night, and low-visibility conditions.
Standard computer vision solutions rely on brittle color-masking that fails catastrophically against real-world highway physics (headlight glare, concrete crash barriers, and chaotic foliage).
RetroVision AI discards basic color-blob detection in favor of Structural Gradient Physics and Spatial Perspective Mathematics.
- Inverse Perspective Mapping (IPM): Warps the 2D dashcam feed into a top-down "Bird's Eye View" matrix. This mathematically isolates true vertical lane markings while instantly distorting and filtering out diagonal noise like concrete side-barriers.
- Sobel-X Gradient Analysis: Detects the physical structural edges of painted asphalt rather than relying on washed-out color thresholds, granting immunity to nighttime headlight glare.
- Geometric Solidity & Edge Density Verification: A two-pass filtration system for overhead destination hoardings. By calculating convex solidity (>0.55) and internal Canny edge-density, the AI perfectly distinguishes between a text-heavy NHAI hoarding and chaotic roadside trees.
- Dynamic Day/Night Auto-Calibration: Continuously calculates the ambient
v_channelmean to automatically dynamically adjust retroreflectivity baselines, preventing signal washout at 2:00 AM. - Centroid Proximity Tracking: An advanced Intersection-over-Union (IoU) alternative that tracks the mathematical center-point of assets. This memory buffer completely eliminates UI jitter and maintains object IDs even when occluded by passing trucks at 100 km/h.
- The Eraser (YOLOv8s Blackout): Dynamically masks active traffic classes (cars, trucks, pedestrians) with an expanded bounding box to kill headlight bleed before the CV pipeline processes the frame.
- 90th Percentile Luminance: Calculates the true retroreflective micro-prisms of the signage text, strictly ignoring the dark green non-reflective backgrounds that corrupt standard mean-brightness calculations.
Ensure you have Python 3.10+ installed.
git clone https://github.com/YOUR_USERNAME/RetroVision-AI.git
cd RetroVision_AI
pip install -r requirements.txtPlace your raw dashcam footage (for example, demo_input.mp4) in the project root directory.
python main.pyThe ADAS pipeline outputs a web-optimized processed_demo_input.mp4 (H.264/avc1 when available) to the output/ directory, including overlaid diagnostic tracking and luminance scores.
- Keep
yolov8s.ptin the project root. If missing, Ultralytics may auto-download it on first run. - Processed videos are written to the
output/directory.
RetroVision AI is currently a Zero-Shot Heuristic Baseline. It demonstrates that high-fidelity luminance tracking is possible without expensive LiDAR or custom hardware.
With funding and deployment via the NHAI Innovation Hackathon, Phase 2 is designed to move from strong heuristic accuracy toward production-grade reliability by injecting custom ML weights and deployment tooling.
- Custom NHAI YOLO Dataset: Train a proprietary YOLOv8 model specifically on Indian highway infrastructure classes (gantries, informatory boards, road studs, painted lane lines) to replace generic COCO-domain assumptions.
- GPS/GIS Integration: Link embedded dashcam coordinates with tracker outputs to auto-flag precise latitude/longitude of degraded signs for NHAI maintenance dashboards.
- Edge Deployment: Compile and optimize the pipeline for real-time inference on low-cost edge hardware (for example, Jetson Nano) mounted in existing NHAI patrol vehicles.
Built with precision for the NHAI Innovation Hackathon.