bambi-models / README.md
cpraschl's picture
Upload README.md with huggingface_hub
5dbce6d verified
---
license: apache-2.0
tags:
- object-detection
- wildlife
- thermal
- rgb
- drone
- ultralytics
- yolo
datasets:
- custom
pipeline_tag: object-detection
library_name: ultralytics
---
# Wildlife Detection with YOLOv26 β€” Drone RGB & Thermal Models
A collection of five **YOLOv26x** models fine-tuned for **wildlife detection in drone imagery**, supporting both **RGB** and **thermal (infrared)** modalities. Models were trained using the [Ultralytics](https://github.com/ultralytics/ultralytics) framework on 1024Γ—1024 px drone images.
---
## Models Overview
| Model | Modality | Dataset | Epochs | mAP50 | mAP50-95 | Notes |
|---|---|---|---|---|---|---|
| `thermal_original` | Thermal | Original thermal dataset | 25 | 0.217 | β€” | Baseline thermal model |
| `thermal_merged` | Thermal | Original + supplemental thermal data | 23 | 0.390 | 0.250 | Refined thermal model |
| `rgb` | RGB | Full RGB dataset | 72 | 0.946 | 0.655 | Primary RGB model |
| `matched_rgb` | RGB | Matched RGB-thermal pairs | 43 | 0.731 | 0.431 | Cross-modal comparison |
| `matched_thermal` | Thermal | Matched RGB-thermal pairs | 27 | 0.719 | 0.289 | Cross-modal comparison |
> **Matched models** were trained on the same spatially co-registered scene pairs to enable fair modality comparison.
---
## Training Details
All models share the following configuration:
| Parameter | Value |
|---|---|
| Base model | `yolo26x.pt` |
| Image size | 1024 Γ— 1024 px |
| Batch size | 4 |
| Max epochs | 200 |
| Early stopping patience | 20 epochs |
| Optimizer | Auto |
| AMP (mixed precision) | Enabled |
| Close mosaic | Last 10 epochs |
| Data augmentation | RandAugment, erasing (p=0.4), fliplr (p=0.5) |
---
## Repository Structure
```
.
β”œβ”€β”€ README.md
β”œβ”€β”€ inference.py # Sample inference code
β”œβ”€β”€ thermal_original/
β”‚ β”œβ”€β”€ weights/
β”‚ β”‚ β”œβ”€β”€ best.pt # Best checkpoint
β”‚ β”‚ └── last.pt # Last checkpoint
β”‚ β”œβ”€β”€ args.yaml # Training configuration
β”‚ β”œβ”€β”€ results.csv # Per-epoch training metrics
β”‚ └── results.png # Training curves
β”œβ”€β”€ thermal_merged/
β”‚ └── ...
β”œβ”€β”€ rgb/
β”‚ └── ...
β”œβ”€β”€ matched_rgb/
β”‚ └── ...
└── matched_thermal/
└── ...
```
---
## Quick Start
### Installation
```bash
pip install ultralytics
```
### Load a model and run inference
```python
from ultralytics import YOLO
# Choose your model
model = YOLO("rgb/weights/best.pt") # RGB drone imagery
# model = YOLO("thermal_merged/weights/best.pt") # Thermal imagery
# Run inference on an image
results = model("path/to/your/image.jpg")
# Display / save results
results[0].show()
results[0].save("output.jpg")
# Access detections
for box in results[0].boxes:
print(f"Class: {box.cls.item()}, Conf: {box.conf.item():.2f}, BBox: {box.xyxy[0].tolist()}")
```
### Batch inference
```python
from ultralytics import YOLO
from pathlib import Path
model = YOLO("rgb/weights/best.pt")
# Run on a folder of images
results = model(
source="path/to/images/",
imgsz=1024,
conf=0.25,
iou=0.45,
save=True,
project="detections",
name="run"
)
```
### Modality comparison (matched dataset)
```python
from ultralytics import YOLO
rgb_model = YOLO("matched_rgb/weights/best.pt")
thermal_model = YOLO("matched_thermal/weights/best.pt")
# Run both models on co-registered image pairs
rgb_results = rgb_model("rgb_frame.jpg", imgsz=1024, conf=0.25)
thermal_results = thermal_model("thermal_frame.png", imgsz=1024, conf=0.25)
print(f"RGB detections: {len(rgb_results[0].boxes)}")
print(f"Thermal detections: {len(thermal_results[0].boxes)}")
```
See **`inference.py`** for a complete script with CLI argument parsing.
---
## Results Visualizations
Training curves, precision-recall curves, and validation batch predictions are included in each model subdirectory (`.png` / `.jpg` files).
---
## License
Apache 2.0 β€” see `LICENSE`.