Monolithic repository for the Pyronear temporal smoke classifier: train it, evaluate it, and serve it behind an API.
The model is a per-tube smoke classifier: a YOLO detector proposes boxes, boxes are linked into temporal tubes (greedy IoU), each tube's frames are cropped to 224×224 patches and scored by a ViT (DINOv2) backbone + transformer head that emits one logit per tube.
Four independent packages, each with its own pyproject.toml and tests/.
| Path | Import | Purpose |
|---|---|---|
core/ |
temporal_model.core |
Model, tube building, patch extraction, inference, packaging. |
train/ |
temporal_model.train |
DVC training pipeline. Depends on core. |
eval/ |
temporal_model.eval |
DVC evaluation pipeline (packaged-model protocol metrics). Depends on core. |
api/ |
temporal_model.api |
FastAPI serving layer, shipped as a Docker service. Depends on core. |
train/eval/api depend on core via a uv path source
(temporal-model-core = { path = "../core", editable = true }). core and
train pull in PyTorch / timm / ultralytics, so their first uv sync is large.
make install # uv sync across all four packages
make test # pytest across all four packages
make lint # ruff check across all four packagesPer package, cd <pkg> && make install|lint|format|test.
make serve # API + MinIO via docker compose, http://localhost:8000 (GET /health)Equivalent to cd api && docker compose up --build. The compose stack ships
local-dev MinIO defaults (bucket frames, minioadmin creds); drop a
model.zip under api/models/ for /health to report model_loaded: true.
Ported from the Pyronear vision-rd
research repo's bbox-tube-temporal work:
core/— fromlib/bbox-tube-temporaltrain/andeval/— fromexperiments/temporal-models/bbox-tube-temporal