How pratikchetry/satellite-tile-intelligence-api works
This repository is a CPU-oriented satellite land-use classification API with a reproducible model-training and evaluation workflow. A client submits image bytes to the FastAPI classify endpoint; shared preprocessing and inference produce a class, probabilities, and an uncertainty flag, then the API records an auditable prediction and returns its ID. Training selects a backbone/head and validation-derived threshold for the artifact used at serving time. Evaluation reuses the serving classifier on held-out tiles. The graph follows the shown calls and README-documented capabilities; data-generation directories and unsampled implementations are not inferred.
Main entry points: main.py FastAPI endpoints · classifier.py Tile classifier · train_head.py Head training and selection · storage.py Prediction storage
Components 12
API serving
- FastAPI endpoints
app/main.py
Inference
- Tile classifier
app/classifier.py - Image preprocessing
app/preprocessing.py - Classifier artifact
models/classifier_head.pkl
Model development
- Head training and selection
scripts/train_head.py - Threshold selection
scripts/train_head.py
Evaluation and audit
- Prediction storage
app/storage.py - SQLite predictions
app/storage.py - Held-out evaluation
scripts/evaluate.py - Evaluation labels
data/eval_labels.csv
Other components
- API client
- Human reviewer
Connections 13
- API client → FastAPI endpoints: submits tile
README.md - FastAPI endpoints → Tile classifier: requests prediction
app/main.py - Tile classifier → Image preprocessing: preprocesses image
app/classifier.py - Tile classifier → Classifier artifact: loads model
app/classifier.py - FastAPI endpoints → Prediction storage: saves prediction
app/main.py - Prediction storage → SQLite predictions: writes and reads
app/storage.py - FastAPI endpoints → Prediction storage: checks health
app/main.py - Head training and selection → Image preprocessing: extracts features
scripts/train_head.py - Head training and selection → Threshold selection: sweeps threshold
scripts/train_head.py - Head training and selection → Classifier artifact: writes artifact
scripts/train_head.py - Held-out evaluation → Tile classifier: classifies tiles
scripts/evaluate.py - Held-out evaluation → Evaluation labels: reads labels
scripts/evaluate.py - FastAPI endpoints → Human reviewer: flags uncertain
README.md