YOLOv11s for Early Wildfire Detection
This repository contains a compact object detection model based on YOLOv11s, optimized by Pyronear for early-stage wildfire detection. The model is trained to identify smoke plumes with high precision and minimal false positives using aerial and ground-level imagery collected across diverse environments.
π Model Overview
- Architecture: YOLOv11s (small variant)
- Task: Single-class object detection (wildfire smoke)
- Backends: TorchScript, ONNX (CPU, MPS), NCNN (CPU, MPS)
- Resolution: 1024 Γ 1024
- Training epochs: 45
- Optimizer: AdamW
- Augmentations: RandAugment, mixup, mosaic, erasing, color jitter
π¦ Available Formats
Format | Backend | File |
---|---|---|
NCNN | CPU | ncnn_cpu_yolo11s-colorful-chameleon_v3.0.0_7bd9f32.tar.gz |
NCNN | MPS | ncnn_mps_yolo11s-colorful-chameleon_v3.0.0_7bd9f32.tar.gz |
ONNX | CPU | onnx_cpu_yolo11s-colorful-chameleon_v3.0.0_7bd9f32.tar.gz |
ONNX | MPS | onnx_mps_yolo11s-colorful-chameleon_v3.0.0_7bd9f32.tar.gz |
PyTorch | Any | best.pt (SHA256: e3667439... ) |
The
_7bd9f32
suffix refers to the source Git commit used to build this release.
π Dataset
Source: Pyronear wildfire imagery repository
Size: ~5.9M images
Structure: YOLO-format bounding boxes with a single
fire
classPreprocessing:
- 5% random sampling
- Cleaned, stratified by region
- Full-resolution pipeline with 1024px square crops
ποΈββοΈ Training Details
Config:
best.yaml
Command:
python train.py --data data.yaml --model yolo11s.pt --epochs 45 --imgsz 1024 --batch 16 --optimizer AdamW --pretrained
DVC hash:
- Model:
6ea728f6abf7c8de6eee661e52840893.dir
- Data:
08dc4b6823c84cd24507003aaa4d5cfb.dir
- Model:
Perfect, thanks for sharing the full Classifier
class implementation.
Here is the updated Inference section for your README.md
, reflecting the correct usage of Classifier
from pyroengine.vision
, and linking back to the source code on GitHub:
π§ Inference
You can run inference using the format that best suits your environment:
β PyTorch (.pt) with Ultralytics
from ultralytics import YOLO
model = YOLO("best.pt") # or path to your model
results = model.predict(source="image.jpg", imgsz=1024, conf=0.25)
results.show() # Display results with smoke bounding boxes
This method uses the official Ultralytics YOLO library.
βοΈ ONNX and NCNN via PyroβEngine
For ONNX or NCNN inference, use the Classifier
class from pyroengine.vision, developed by Pyronear.
from PIL import Image
from pyroengine.vision import Classifier
# Load image
img = Image.open("your_image.jpg")
# Load classifier (auto-downloads model from Hugging Face if needed)
clf = Classifier(format="onnx", conf=0.15, model_folder="data") # or format="ncnn"
# Run inference
preds = clf(img)
# preds is a NumPy array of shape (N, 5): [x1, y1, x2, y2, confidence]
print(preds)
The Classifier
automatically handles preprocessing, backend selection (ONNX or NCNN), and postprocessing including confidence thresholding, normalization, and occlusion masking.
π License
This model is released under the Apache 2.0 License. Feel free to use, adapt, and redistribute with attribution to Pyronear.
π€ Citation
If you use this model in your research or product, please cite Pyronear and/or link to https://pyronear.org.