How rthx-m/m-roadgrid works
PWD Road Intelligence manages road projects and image-based inspections, then assigns urgency and rankings. Users create projects, upload inspection images, and review project history and results. Inspection creation stores images and delegates each image to the analysis orchestrator, which runs YOLO detection, Gemini assessment, and priority scoring; project operations also classify road context and maintain JSON-backed records. The README identifies the detection model and purpose. The graph follows shown calls and UI requests; database.py explicitly says the app uses JSON, and unsampled behavior is not inferred.
Main entry points: projects.py Project API · app.js Road dashboard · inspections.py Inspection API · main.py FastAPI app
Components 14
User experience
- Road dashboard
frontend/js/app.js - FastAPI app
app/main.py
Project management
- Project API
app/api/projects.py - Road context AI
app/ai/inspector.py - Priority scoring
app/assessment/scoring.py
Inspection analysis
- Inspection API
app/api/inspections.py - Image analysis
app/api/analysis.py - YOLO detection
app/ai/yolo.py - Visual assessment
app/ai/inspector.py
Persistence
- Road records
data/road_data.json - Inspection images
data
Other components
- PWD engineer
- Google Gemini
- RDD2022 model
Connections 20
- PWD engineer → Road dashboard: uses
frontend/js/app.js - Road dashboard → FastAPI app: requests API
frontend/js/app.js - FastAPI app → Project API: mounts routes
app/main.py - FastAPI app → Inspection API: mounts routes
app/main.py - FastAPI app → Road dashboard: serves app
app/main.py - Project API → Road records: reads and writes
app/api/projects.py - Inspection API → Road records: reads and writes
app/api/inspections.py - Inspection API → Inspection images: stores images
app/api/inspections.py - Project API → Inspection images: removes project files
app/api/projects.py - Project API → Road context AI: classifies context
app/api/projects.py - Road context AI → Google Gemini: requests generation
app/ai/inspector.py - Inspection API → Image analysis: analyzes images
app/api/inspections.py - Image analysis → YOLO detection: detects damage
app/api/analysis.py - YOLO detection → RDD2022 model: runs inference
app/ai/yolo.py - Image analysis → Visual assessment: assesses image
app/api/analysis.py - Visual assessment → Google Gemini: requests generation
app/ai/inspector.py - Image analysis → Priority scoring: calculates priority
app/api/analysis.py - Project API → Priority scoring: recalculates priority
app/api/projects.py - Road dashboard → Project API: requests projects
frontend/js/app.js - Road dashboard → Inspection API: submits inspection
frontend/js/app.js