An MLOps project for detecting buffalo, elephant, rhino, and zebra in images.
# Wildlife MLOps
Learn one object-detection lifecycle. The model detects buffalo, elephant,
rhino, and zebra.
## Architecture
```mermaid
flowchart LR
data[Versioned wildlife dataset] --> validate[Dataset validation]
validate --> train[Baseline training]
train --> validation_metrics[Validation metrics]
train --> checkpoint[best.pt checkpoint]
train --> mlflow[Local MLflow]
validation_metrics --> candidate[Release candidate]
checkpoint --> candidate
candidate --> package[Package: checkpoint + inference code]
candidate --> approval[Human approval]
approval --> sealed[One sealed test evaluation]
sealed --> service[FastAPI service\nloads one pinned candidate]
client[Local prediction client] --> service
service --> response[Prediction JSON\nversion + SHA-256 checksum]
response --> rollback[Manual A → B → A rollback evidence]
service --> service_metrics["/metrics/ endpoint"]
service_metrics --> prometheus[Prometheus\nscrapes every 5 seconds]
prometheus --> grafana[Grafana\nrequest, latency, error, and distribution graphs]
response --> samples[Sampled prediction metadata\nno raw images]
labels[Later ground-truth labels] --> quality[Sampled precision and recall report]
samples --> quality
failed[Failed candidate start] --> recovery[Recovery health evidence]
service --> recovery
```
## Setup
```sh
make bootstrap
make doctor
```
## Learn the data
```sh
make data-download
make data-validate
make data-visualize
```
Open `artifacts/data-preview/train.png`. Check that the boxes match the animals.
## Learn training
```sh
make predict-pretrained
make train-overfit
make train-smoke
make train-baseline
```
Each training command creates a new directory under `artifacts/`. Open its
`results.csv`, `run.json`, and `weights/best.pt`.
`train-overfit` uses a few images twice. Inspect whether its loss falls.
`train-smoke` proves the full training path works quickly. `train-baseline`
uses the whole training split.
## Track a run
Copy the example credentials once, then start local …