AVIS / comparative_analysis.md
X2-0's picture
HF Clean Deploy
1c0c94d
|
Raw
History Blame Contribute Delete
4.29 kB

Comparative Analysis: AVIS vs. RoadX

This document provides a comprehensive, feature-by-feature comparison between AVIS (our system) and RoadX (the competitor project), analyzing their architectural choices, strengths, weaknesses, and model implementations.


1. High-Level Architecture & Scalability

Feature AVIS (Gridlock) RoadX Winner & Why
System Design Modular Monolith (FastAPI + React) Single-App Monolith (Flask) AVIS. A decoupled frontend and backend is modern and scalable. RoadX relies on Flask HTML templates, which limits UI reactivity.
Asynchronous Processing Dedicated Redis Queue + Background Workers Python Background Threads AVIS. Using Redis ensures heavy CV tasks don't block the API. RoadX's threading on a single Flask app will bottleneck and drop frames under heavy load.
Data & Storage PostgreSQL + MinIO (S3-compatible) SQLite + Local File System AVIS. AVIS is built for cloud/production scale. RoadX is limited to a single server's disk space.

2. Core Machine Learning & Logic

Feature AVIS (Gridlock) RoadX Winner & Why
Verification & Accuracy Hybrid: CV + VLM (Gemini Flash) Pure CV (YOLOv8 + ByteTrack) AVIS (for accuracy). RoadX relies entirely on geometric CV, which has high false-positive rates for edge cases. AVIS uses Gemini as a final judge, ensuring court-ready evidence.
Video & RTSP Support ❌ Single Image Only ✅ RTSP Streams & Video RoadX. By using ByteTrack (assigning IDs to vehicles across frames), RoadX can easily detect temporal violations (Wrong-Way, Speeding) without needing a VLM.
ALPR (Number Plates) fast-alpr (Generic) Custom Plate.pt + EasyOCR RoadX. RoadX trained a custom YOLO model specifically to find Indian plates, then runs OCR on the crop. This is vastly superior to generic out-of-the-box ALPR tools.
Decision Logic Deterministic Evidence Graph Imperative Python logic AVIS. Building a node-based "Evidence Graph" is much more explainable in a court of law than nested if/else Python statements.

3. Features & End-User Experience

Feature AVIS (Gridlock) RoadX Winner & Why
User Interface Hardware-accelerated, dynamic React UI Basic HTML/Bootstrap Flask templates AVIS. The observability trace logs, empty-state hero, and modern theming in AVIS provide a vastly superior enterprise feel.
End-to-End Enforcement Generates database records PDF Challans + Email/WhatsApp RoadX. RoadX completes the enforcement loop by actually generating a legal PDF and notifying the citizen.
Access Control Single unified dashboard Admin vs. Citizen Portal RoadX. Separating the dashboard into a secure Admin police view and a public citizen ticket-checking view is highly practical.

Summary of Pros & Cons

AVIS (Our System)

  • Pros: Exceptionally scalable architecture (Redis, MinIO, Postgres). Highly accurate due to VLM (Gemini) fallback logic preventing hallucinations. Beautiful, observable, enterprise-grade React frontend.
  • Cons: Lacks temporal tracking (video processing). Relies on generic ALPR which struggles with dirty/angled Indian plates. Incomplete enforcement loop (no PDFs or emails).

RoadX (Competitor)

  • Pros: Handles live RTSP video natively using ByteTrack. Excellent Indian license plate detection via custom YOLO weights. Generates real-world PDF challans and emails.
  • Cons: Monolithic Flask app will choke on high load. Relies entirely on CV rules, meaning it will likely generate false-positive challans that a human/VLM would easily reject.

How RoadX Handled Video (The "Secret")

You asked how they handle video: They use an algorithm called ByteTrack. Instead of just finding a car, ByteTrack assigns an ID to a car in Frame 1 (e.g., Car #45). In Frame 2, it finds Car #45 again and draws a line between its old and new position. By tracking this trajectory over 20-30 frames, they can easily calculate if the car is moving in the wrong direction (Wrong-Way) or how fast it is moving, without needing complex AI reasoning.