cpraschl commited on
Commit
5dbce6d
Β·
verified Β·
1 Parent(s): 0155191

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +157 -0
README.md ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - object-detection
5
+ - wildlife
6
+ - thermal
7
+ - rgb
8
+ - drone
9
+ - ultralytics
10
+ - yolo
11
+ datasets:
12
+ - custom
13
+ pipeline_tag: object-detection
14
+ library_name: ultralytics
15
+ ---
16
+
17
+ # Wildlife Detection with YOLOv26 β€” Drone RGB & Thermal Models
18
+
19
+ 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.
20
+
21
+ ---
22
+
23
+ ## Models Overview
24
+
25
+ | Model | Modality | Dataset | Epochs | mAP50 | mAP50-95 | Notes |
26
+ |---|---|---|---|---|---|---|
27
+ | `thermal_original` | Thermal | Original thermal dataset | 25 | 0.217 | β€” | Baseline thermal model |
28
+ | `thermal_merged` | Thermal | Original + supplemental thermal data | 23 | 0.390 | 0.250 | Refined thermal model |
29
+ | `rgb` | RGB | Full RGB dataset | 72 | 0.946 | 0.655 | Primary RGB model |
30
+ | `matched_rgb` | RGB | Matched RGB-thermal pairs | 43 | 0.731 | 0.431 | Cross-modal comparison |
31
+ | `matched_thermal` | Thermal | Matched RGB-thermal pairs | 27 | 0.719 | 0.289 | Cross-modal comparison |
32
+
33
+ > **Matched models** were trained on the same spatially co-registered scene pairs to enable fair modality comparison.
34
+
35
+ ---
36
+
37
+ ## Training Details
38
+
39
+ All models share the following configuration:
40
+
41
+ | Parameter | Value |
42
+ |---|---|
43
+ | Base model | `yolo26x.pt` |
44
+ | Image size | 1024 Γ— 1024 px |
45
+ | Batch size | 4 |
46
+ | Max epochs | 200 |
47
+ | Early stopping patience | 20 epochs |
48
+ | Optimizer | Auto |
49
+ | AMP (mixed precision) | Enabled |
50
+ | Close mosaic | Last 10 epochs |
51
+ | Data augmentation | RandAugment, erasing (p=0.4), fliplr (p=0.5) |
52
+
53
+ ---
54
+
55
+ ## Repository Structure
56
+
57
+ ```
58
+ .
59
+ β”œβ”€β”€ README.md
60
+ β”œβ”€β”€ inference.py # Sample inference code
61
+ β”œβ”€β”€ thermal_original/
62
+ β”‚ β”œβ”€β”€ weights/
63
+ β”‚ β”‚ β”œβ”€β”€ best.pt # Best checkpoint
64
+ β”‚ β”‚ └── last.pt # Last checkpoint
65
+ β”‚ β”œβ”€β”€ args.yaml # Training configuration
66
+ β”‚ β”œβ”€β”€ results.csv # Per-epoch training metrics
67
+ β”‚ └── results.png # Training curves
68
+ β”œβ”€β”€ thermal_merged/
69
+ β”‚ └── ...
70
+ β”œβ”€β”€ rgb/
71
+ β”‚ └── ...
72
+ β”œβ”€β”€ matched_rgb/
73
+ β”‚ └── ...
74
+ └── matched_thermal/
75
+ └── ...
76
+ ```
77
+
78
+ ---
79
+
80
+ ## Quick Start
81
+
82
+ ### Installation
83
+
84
+ ```bash
85
+ pip install ultralytics
86
+ ```
87
+
88
+ ### Load a model and run inference
89
+
90
+ ```python
91
+ from ultralytics import YOLO
92
+
93
+ # Choose your model
94
+ model = YOLO("rgb/weights/best.pt") # RGB drone imagery
95
+ # model = YOLO("thermal_merged/weights/best.pt") # Thermal imagery
96
+
97
+ # Run inference on an image
98
+ results = model("path/to/your/image.jpg")
99
+
100
+ # Display / save results
101
+ results[0].show()
102
+ results[0].save("output.jpg")
103
+
104
+ # Access detections
105
+ for box in results[0].boxes:
106
+ print(f"Class: {box.cls.item()}, Conf: {box.conf.item():.2f}, BBox: {box.xyxy[0].tolist()}")
107
+ ```
108
+
109
+ ### Batch inference
110
+
111
+ ```python
112
+ from ultralytics import YOLO
113
+ from pathlib import Path
114
+
115
+ model = YOLO("rgb/weights/best.pt")
116
+
117
+ # Run on a folder of images
118
+ results = model(
119
+ source="path/to/images/",
120
+ imgsz=1024,
121
+ conf=0.25,
122
+ iou=0.45,
123
+ save=True,
124
+ project="detections",
125
+ name="run"
126
+ )
127
+ ```
128
+
129
+ ### Modality comparison (matched dataset)
130
+
131
+ ```python
132
+ from ultralytics import YOLO
133
+
134
+ rgb_model = YOLO("matched_rgb/weights/best.pt")
135
+ thermal_model = YOLO("matched_thermal/weights/best.pt")
136
+
137
+ # Run both models on co-registered image pairs
138
+ rgb_results = rgb_model("rgb_frame.jpg", imgsz=1024, conf=0.25)
139
+ thermal_results = thermal_model("thermal_frame.png", imgsz=1024, conf=0.25)
140
+
141
+ print(f"RGB detections: {len(rgb_results[0].boxes)}")
142
+ print(f"Thermal detections: {len(thermal_results[0].boxes)}")
143
+ ```
144
+
145
+ See **`inference.py`** for a complete script with CLI argument parsing.
146
+
147
+ ---
148
+
149
+ ## Results Visualizations
150
+
151
+ Training curves, precision-recall curves, and validation batch predictions are included in each model subdirectory (`.png` / `.jpg` files).
152
+
153
+ ---
154
+
155
+ ## License
156
+
157
+ Apache 2.0 β€” see `LICENSE`.