How bitbyob/raahnumaa-ai works
RaahNumaa AI serves Karachi traffic prediction and route planning through a Flask web app. Users submit time, weather, event, and (for routing) endpoint and mode inputs; the app returns congestion predictions, hourly batches, heatmap data, or an A*-computed route with distance, ETA, and segment details. The ML model is trained from synthetic, feature-engineered data and supplies congestion levels to routing. README-documented map visualization and navigation capabilities are included, though the template source was not provided for inspection.
Main entry points: app.py Flask routes · index.html Prediction UI · predictor.py Traffic prediction · astar.py A* route search
Components 14
Web application
- Flask routes
app.py - Prediction UI
templates/index.html - Route map UI
templates/phase2.html - Route visualization
templates/phase2.html - Congestion heatmap
app.py - Hourly predictions
app.py
Traffic prediction
- Traffic prediction
models/predictor.py - Trained model files
models
Route optimization
- Node traffic map
routing/astar.py - Karachi road network
routing/karachi_graph.py - A* route search
routing/astar.py
Traffic data
- Synthetic data generator
data/generate_data.py - Generated traffic data
data/traffic_data.csv
Other components
- Web user
Connections 23
- Web user → Prediction UI: uses
README.md - Web user → Route map UI: uses
README.md - Prediction UI → Flask routes: submits inputs
- Route map UI → Flask routes: requests routes
- Flask routes → Traffic prediction: predicts traffic
app.py - Flask routes → Traffic prediction: re-trains
app.py - Flask routes → Karachi road network: builds graph
app.py - Flask routes → Node traffic map: builds traffic map
app.py - Flask routes → A* route search: searches route
app.py - Flask routes → Hourly predictions: generates hourly data
app.py - Flask routes → Congestion heatmap: generates grid data
app.py - Flask routes → Prediction UI: renders
app.py - Flask routes → Route map UI: renders
app.py - Traffic prediction → Synthetic data generator: generates training data
models/predictor.py - Traffic prediction → Trained model files: loads and saves
models/predictor.py - Synthetic data generator → Generated traffic data: writes CSV
data/generate_data.py - Node traffic map → Traffic prediction: predicts per node
routing/astar.py - A* route search → Karachi road network: reads network
routing/astar.py - A* route search → Node traffic map: weights by congestion
routing/astar.py - A* route search → Route visualization: returns route details
README.md - Route map UI → Route visualization: shows map
README.md - Prediction UI → Hourly predictions: shows hourly chart
- Prediction UI → Congestion heatmap: shows heatmap