Upload README.md with huggingface_hub
Browse files9 unmodified lines101112131415161 unmodified line18192021222324255 unmodified lines3132333435363738394041426 unmodified lines4950515253545538 unmodified lines9495969798991009 unmodified lines# Temporal Smoke Model (bbox-tube-temporal)> **Latest release:** [`v0.3.0`](https://huggingface.co/pyronear/temporal-model/tree/v0.3.0) — pin this revision for reproducibility, or omit `revision=` to always get the latest. All releases: the **Files and versions** tab.A temporal wildfire-**smoke** classifier for short sequences of camera frames. AYOLO detector proposes boxes, boxes are linked across frames into temporal1 unmodified linehead, and a logistic calibrator turns the tube logits into a calibratedprobability and a keep/discard decision.This repo ships a single self-contained **`model.zip`**, versioned by HuggingFacerevision/tag (`v<version>`). Each release bundles everything needed to run:| file | purpose ||---|---|5 unmodified linesThe model runs YOLO **itself** — you pass only raw frames, no detections.## UsageInstall the inference package (`temporal_model.core`):```bashpip install "git+https://github.com/pyronear/temporal-model.git#subdirectory=core"```Download a versioned `model.zip` and run it on a **temporally ordered** sequence6 unmodified linesfrom temporal_model.core.model import BboxTubeTemporalModel# 1. Download a specific release (pin the revision).model_zip = hf_hub_download("pyronear/temporal-model", "model.zip", revision="v0.3.0")# 2. Temporally-ordered frames. Filenames carry timestamps# (<prefix>_<YYYY-MM-DDTHH-MM-SS>.jpg); the order is the time order.38 unmodified linesdocker run --gpus all -p 8000:8000 \-e TEMPORAL_API_S3_BUCKET=<frames-bucket> \-e TEMPORAL_API_S3_ENDPOINT_URL=<s3-endpoint> \pyronear/temporal-model-api:0.3.0# POST /predict {"frames": ["<s3-key>", ...]} GET /health```9 unmodified lines101112131415161 unmodified line1819202122232425265 unmodified lines32333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980816 unmodified lines8889909192939438 unmodified lines1331341351361371381399 unmodified lines# Temporal Smoke Model (bbox-tube-temporal)> **Latest release:** [`v0.4.0`](https://huggingface.co/pyronear/temporal-model/tree/v0.4.0) — pin this revision for reproducibility, or omit `revision=` to always get the latest. All releases: the **Files and versions** tab.A temporal wildfire-**smoke** classifier for short sequences of camera frames. AYOLO detector proposes boxes, boxes are linked across frames into temporal1 unmodified linehead, and a logistic calibrator turns the tube logits into a calibratedprobability and a keep/discard decision.This repo ships a self-contained **`model.zip`**, versioned by HuggingFacerevision/tag (`v<version>`), plus a torch-free **`model_onnx.zip`** derived fromit (see *ONNX runtime* below). Each `model.zip` bundles everything needed to run:| file | purpose ||---|---|5 unmodified linesThe model runs YOLO **itself** — you pass only raw frames, no detections.## ONNX runtime (no torch)`model_onnx.zip` carries the same classifier exported to ONNX (fixed input`patches[1, 20, 3, 224, 224]` + `mask[1, 20]` → `logit[1]`), the inferenceconfig and the calibrator, but **no YOLO**: you supply the per-frame detections(e.g. from a detector already running on the device). It runs on numpy + pillow+ onnxruntime only — the intended runtime for edge devices such as aRaspberry Pi:```bashpip install "temporal-model-core[onnx] @ git+https://github.com/pyronear/temporal-model.git#subdirectory=core"``````pythonfrom pathlib import Pathfrom huggingface_hub import hf_hub_downloadfrom temporal_model.core import Detection, FrameDetectionsfrom temporal_model.core.onnx_model import OnnxTemporalModelonnx_zip = hf_hub_download("pyronear/temporal-model", "model_onnx.zip", revision="v0.4.0")model = OnnxTemporalModel.from_package(Path(onnx_zip))frames = model.load_sequence(sorted(Path("my_sequence").glob("*.jpg")))# One FrameDetections per frame, keyed by frame_id, boxes as normalized (cx, cy, w, h).detections = {f.frame_id: FrameDetections(frame_idx=i, frame_id=f.frame_id, timestamp=f.timestamp,detections=[Detection(class_id=0, cx=0.5, cy=0.4, w=0.05, h=0.03, confidence=0.6)],)for i, f in enumerate(frames)}out = model.predict(frames, frame_detections=detections)```The manifest of `model_onnx.zip` records the SHA-256 of the `model.zip` it wasexported from and the measured torch/ONNX logit difference.## UsageInstall the inference package (`temporal_model.core`):```bashpip install "temporal-model-core[torch] @ git+https://github.com/pyronear/temporal-model.git#subdirectory=core"```Download a versioned `model.zip` and run it on a **temporally ordered** sequence6 unmodified linesfrom temporal_model.core.model import BboxTubeTemporalModel# 1. Download a specific release (pin the revision).model_zip = hf_hub_download("pyronear/temporal-model", "model.zip", revision="v0.4.0")# 2. Temporally-ordered frames. Filenames carry timestamps# (<prefix>_<YYYY-MM-DDTHH-MM-SS>.jpg); the order is the time order.38 unmodified linesdocker run --gpus all -p 8000:8000 \-e TEMPORAL_API_S3_BUCKET=<frames-bucket> \-e TEMPORAL_API_S3_ENDPOINT_URL=<s3-endpoint> \pyronear/temporal-model-api:0.4.0# POST /predict {"frames": ["<s3-key>", ...]} GET /health```
README.md+45-6