How ezykl/r2r-model works
R2R is a Flask image-classification API for the mobile app. Its main workflow accepts an uploaded image, validates and preprocesses it, runs the trained model, applies confidence thresholds and Accepted/Prohibited rules, then returns prediction results. A separate health route reports API availability. The README documents the model’s 180 classes and supported formats; the implementation is concentrated in app.py, so the graph represents those stages as responsibilities within that file rather than separate modules.
Main entry points: app.py Flask routes · r2r_model.keras Trained model
Components 10
HTTP API
- Flask routes
app.py - Health check
app.py - Upload validation
app.py - JSON results
app.py
Image Inference
- Image preprocessing
app.py - Trained model
model/r2r_model.keras - Model inference
app.py
Prediction Results
- Confidence filtering
app.py - Item categories
app.py
Other components
- R2R app client
Connections 13
- R2R app client → Flask routes: sends request
- Flask routes → Health check: dispatches health check
- Flask routes → Upload validation: dispatches prediction
- Upload validation → Image preprocessing: passes valid image
- Image preprocessing → Model inference: passes image tensor
- Flask routes → Trained model: loads at startup
- Model inference → Trained model: runs prediction
- Model inference → Confidence filtering: passes scores
- Confidence filtering → Item categories: categorizes candidates
- Health check → JSON results: returns status
- Confidence filtering → JSON results: formats predictions
- Item categories → JSON results: adds category
- JSON results → R2R app client: returns JSON