https://github.com/pyronear/temporal-model
https://github.com/pyronear/temporal-model
Last synced: 19 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/pyronear/temporal-model
- Owner: pyronear
- License: apache-2.0
- Created: 2026-06-02T12:58:35.000Z (26 days ago)
- Default Branch: main
- Last Pushed: 2026-06-02T16:07:00.000Z (25 days ago)
- Last Synced: 2026-06-02T16:10:56.360Z (25 days ago)
- Language: Python
- Size: 169 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🕐🔥 temporal-model
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.
## Packages
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.
## Quick start
```bash
make install # uv sync across all four packages
make test # pytest across all four packages
make lint # ruff check across all four packages
```
Per package, `cd && make install|lint|format|test`.
### Run the API locally (Docker)
```bash
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`.
## Origin
Ported from the Pyronear [`vision-rd`](https://github.com/pyronear/vision-rd)
research repo's `bbox-tube-temporal` work:
- `core/` — from [`lib/bbox-tube-temporal`](https://github.com/pyronear/vision-rd/tree/main/lib/bbox-tube-temporal)
- `train/` and `eval/` — from [`experiments/temporal-models/bbox-tube-temporal`](https://github.com/pyronear/vision-rd/tree/main/experiments/temporal-models/bbox-tube-temporal)