How mwasifanwar/neurodrive-vision works
Project type and purpose
• Project Type: A modular computer‐vision pipeline for lane detection and road perception research.
• Purpose: Ingest video or image input (file, camera), process frames through a series of vision algorithms (edge detection, ROI extraction, Hough transform, smoothing, tracking), and expose results via a CLI or interactive Gradio UI.
File structure
• app/
• cli.py ← Command‐line interface entry point
• gradio_app.py ← Interactive web demo built with Gradio
• src/
• io.py ← Input/output helpers (video capture, frame loading, result saving)
• pipeline.py ← Orchestrates the sequence of vision steps
• tracker.py ← EMA‐based lane tracking logic
• utils.py ← Shared utilities (logging, drawing helpers)
• vision/ ← Core algorithms as modular plugins
– edges.py ← Edge detection routines (Canny, Sobel)
– hough.py ← Probabilistic Hough transform for line detection
– lines.py ← Line grouping and filtering
– roi.py ← Adaptive region‐of‐interest mapping
– smoothing.py ← Exponential moving average smoothing
• assets/figures/ ← Static assets for documentation or sample outputs
• tests/ ← Unit tests for individual vision modules
• requirements.txt ← Python dependencies (OpenCV, NumPy, Gradio, etc.)
Extract architectural insights from the README
• Real‐time pipeline for autonomous driving research
• Key features: adaptive ROI, probabilistic Hough, EMA smoothing, Gradio UI
• Technology stack: OpenCV & NumPy for CV, Gradio for UI
Main components & their interactions
a. Frontend Layer
• CLI Interface (app/cli.py)
• Gradio Web Demo (app/gradio_app.py)
b. Processing Core
• Pipeline Orchestrator (src/pipeline.py)
• Vision Modules (src/vision/*.py)
• Tracker (src/tracker.py)
• I/O & Config (src/io.py, src/config.py)
• Utils (src/utils.py)
c. Assets & Tests
• assets/figures (static output)
• tests/test_edges.py (validation)
d. External Dependencies
• OpenCV, NumPy (CV & matrix ops)
• Gradio (UI)
Relationships & data flow
• Input source → io.py → pipeline.py
• pipeline.py invokes in order:
1) roi.py → 2) edges.py → 3) hough.py → 4) lines.py → 5) smoothing.py → 6) tracker.py
• CLI or Gradio UI calls pipeline, receives final annotated frames & metrics
Architectural patterns & design principles
• Modular Pipeline Pattern: each vision step is a separate module
• Dependency Injection: config parameters passed into modules at runtime
• Separation of Concerns: UI (app/) vs. core processing (src/) vs. tests/assets
Essential elements
• Clear component names (file or module names)
• Callouts for key technologies (OpenCV/NumPy, Gradio) at component boundaries