FireViewer D-FINE Large V7 — fire and smoke detection
An experimental two-class D-FINE Large detector fine-tuned with DEIM for FireViewer. This repository contains the evaluated V7 EMA weights, a self-contained native inference runtime, and a transparent external benchmark against two frozen reference models.
Status: experimental, not production/emergency ready. On the selected 212-image Home-Fire holdout: mAP50:95 0.2859, AP50 0.4996, AP75 0.2798, precision 0.7178, recall 0.4349, F1 0.5417. Recall fails the 0.50 minimum; the corpus lacks enough negative images and verified independent events for a support-grade claim. The benchmark's execution passed, its support-grade admission did not.
What is included
model.safetensors: 125.14 MB, exact EMA tensors from the evaluated checkpoint; no optimizer, scaler, pickle or training dataset.inference.yml,fireviewer_inference.py, and the pinnedfireviewer_deim/runtime.- Benchmark report, all 12 results (JSON), CSV, source/selection hashes, overlap evidence and scoring-source snapshots.
- Training summary and component/source-rights notices. Corpus images and annotations are not redistributed.
Publication checks: all 1,253 exported tensors are exactly equal to the source EMA state. Reloaded BF16 predictions match the original benchmark adapter exactly on three in-memory synthetic probes, including filtered outputs at 0.05 and 0.5. See export verification. This proves export/reload equivalence, not additional detection quality on real images.
Run inference
Tested with Python 3.11.9, torch 2.11.0 / torchvision 0.26.0, CUDA 12.8, and RTX 5070 Ti. Choose a PyTorch build matching your GPU/driver first. Then:
hf download fireviewer/dfine-large-fire-smoke-v7 --local-dir fireviewer-dfine-v7
cd fireviewer-dfine-v7
python -m pip install -r requirements.txt
python fireviewer_inference.py --image /path/to/photo.jpg --device cuda:0 --precision bf16
For immutable deployment, add --revision <commit-sha-from-the-Files-tab> to hf download.
CPU fallback: --device cpu --precision fp32; CPU speed/quality was not benchmarked.
The helper uses Safetensors and verifies the model/config hashes before loading. No pretrained backbone
download, training setup, private path, HF token, or additional FireViewer repository is required.
This is a native DEIM checkpoint/runtime, not a Transformers AutoModel-compatible export.
from PIL import Image
from fireviewer_inference import FireViewerDFINE
detector = FireViewerDFINE(".", device="cuda:0", precision="bf16")
with Image.open("photo.jpg") as image:
detections = detector.predict(image, threshold=0.5)
# class_id: 0=fire, 1=smoke; score; bbox_xyxy in original-image pixels.
RGB is directly resized to 704x704, converted to [0,1] tensors, without letterboxing or mean/std normalization. FP32 parameters use BF16 autocast on CUDA. Output is score-sorted, at most 100 boxes by default, with confidence >=0.5. Box centers are not validated fire-origin points or geolocations.
Training provenance
V7 selected corpus: 5000 images (4002 train / 486 validation / 512 internal test), 40 total epochs,
704x704, seed 42. Resumed stage: micro-batch 2, accumulation 8, effective batch 16.
This release uses best_stg2.pth, EMA branch, not the final/optimizer state.
Checkpoint SHA-256: 7b26fbf4cf05723670c1fd01da4542ca98fb92aef1e2f0c14dfde4f86184dec5.
Safetensors SHA-256: a43d2fa1269e770e4dd5fa303d2f36591c1d9cb5a8351880c8e6b05c837cd136.
Base: DEIM D-FINE HGNetv2-L COCO 50e. See training summary and runtime provenance. No new training was performed for publication.
Evaluation and limits
| Model | AP50 | AP75 | mAP50:95 | Precision | Recall | F1 | Negative FP |
|---|---|---|---|---|---|---|---|
| D-FINE Large FireViewer V7 | 0.4996 | 0.2798 | 0.2859 | 0.7178 | 0.4349 | 0.5417 | 0.0833 |
| YOLO26m UAV Fire/Smoke | 0.1156 | 0.0310 | 0.0482 | 0.6250 | 0.0929 | 0.1618 | 0.0833 |
| YOLOv8n D-Fire Reference | 0.1119 | 0.0331 | 0.0491 | 0.7333 | 0.0818 | 0.1472 | 0.0000 |
Same selected images/annotations, operating confidence 0.5, IoU 0.5. AP uses candidate confidence 0.05. V7 is 704 BF16; references are 640 FP16, so this is not a controlled architecture comparison. Source independence is limited to declared training sources plus a complete V7 exact/pHash train-overlap screen. The two comparators' full training media were not independently screened.
Only 12 negative images and no verified independent event IDs are available. The sample is selected, not a comprehensive field validation. JPEG50 produces 3/12 negative false alarms. Full definitions, per-class AP, robustness, precision/recall, threshold diagnostics and measurement limits are in the report. Latency was measured on one image, not as end-to-end full-corpus throughput.
License, attribution and safety
Read LICENSE_NOTICE.md before reuse. Code licensing is separate from fine-tuned weights and source data rights; public availability is not a blanket commercial-use grant. Credit the DEIM authors, D-FINE/RT-DETR contributors, and Home-Fire Dataset for the evaluation source. Do not use as the sole basis for emergency alerts, autonomous firefighting or safety-critical decisions. No segmentation, physical ignition-point, geolocation, or event-level field-performance claim is made.