uralman commited on
Commit
25ac16e
Β·
verified Β·
1 Parent(s): 773000e

Rewrite model card for practical use

Browse files
Files changed (1) hide show
  1. README.md +92 -48
README.md CHANGED
@@ -10,87 +10,131 @@ tags:
10
  - object-detection
11
  - face-detection
12
  - widerface
 
13
  pipeline_tag: object-detection
14
  ---
15
 
16
- # YOLO26l face detector (WiderFace fine-tune)
17
 
18
- Single-class **face** detector based on **[Ultralytics YOLO26l](https://docs.ultralytics.com/models/yolo26/)**, fine-tuned on **[WIDER FACE](http://shuoyang1213.me/WIDERFACE/)**.
19
 
20
- This repo contains the Ultralytics `best.pt` checkpoint from a supervised fine-tune of the official YOLO26 large detection model.
 
 
 
 
 
 
 
21
 
22
- > Base model: [YOLO26 documentation](https://docs.ultralytics.com/models/yolo26/) Β· [Ultralytics GitHub](https://github.com/ultralytics/ultralytics)
23
- > Dataset: [WIDER FACE](http://shuoyang1213.me/WIDERFACE/)
24
 
25
- ## Files
26
 
27
- | File | Description |
28
- |------|-------------|
29
- | `best.pt` | Ultralytics YOLO weights (`ultralytics.YOLO`) |
30
- | `metrics.txt` | Snapshot of peak validation metrics from this run |
31
 
32
  ## Quick start
33
 
34
  ```bash
35
- pip install ultralytics
36
- huggingface-cli download uralman/yolo26l-widerface best.pt --local-dir .
37
  ```
38
 
39
  ```python
 
40
  from ultralytics import YOLO
41
 
42
- model = YOLO("best.pt")
43
- results = model.predict("image.jpg", imgsz=1280, conf=0.25)
 
 
 
 
 
 
 
 
 
 
 
44
  ```
45
 
46
- Recommended inference size: **1280** (same as training).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
- ## Training summary
49
 
50
  | Item | Value |
51
  |------|-------|
52
- | Base weights | Ultralytics `yolo26l.pt` |
53
- | Task | `detect`, single class `face` |
54
- | Dataset | WIDER FACE converted to YOLO format (~12.9k train / ~3.2k val) |
55
- | Image size | 1280 |
56
- | Hardware | 2Γ— NVIDIA H100, DDP |
57
- | Batch | 8, AMP, `cache=ram` |
58
- | Schedule | up to 200 epochs, patience 50, cosine LR |
59
- | Augmentations | mosaic, multi-scale, Ultralytics detect defaults |
60
- | Stopped at | epoch **73** (early stop; gains near plateau) |
61
 
62
- ## Validation metrics (WIDER FACE val)
63
-
64
- Ultralytics built-in box metrics on the YOLO-formatted WIDER FACE validation split used for this run. Peak selected by **mAP50-95**:
65
 
66
- | Metric | Epoch 1 | Best (epoch 71) |
67
- |--------|--------:|-------------------------------:|
68
- | Precision | β€” | 0.896 |
69
- | Recall | β€” | 0.725 |
70
- | mAP50 | 0.699 | **0.801** |
71
- | mAP50-95 | 0.331 | **0.455** |
72
 
73
- These are COCO-style Ultralytics mAP scores for this training setup β€” **not** the official WIDER FACE Easy/Medium/Hard evaluation protocol. Useful for reproducing this run; absolute numbers depend on label conversion, `imgsz`, and NMS.
74
 
75
- ## Experiment notes (ClearML)
 
 
76
 
77
- Training was logged in ClearML (project `yolo-face`). Highlights from the run:
 
 
78
 
79
- - Val **mAP50** rose from ~0.70 β†’ ~0.80 and **mAP50-95** from ~0.33 β†’ ~0.455 over ~70 epochs
80
- - Precision / recall at best checkpoint β‰ˆ **0.90 / 0.72**
81
- - Stable epoch time β‰ˆ **6.5–7 min** on 2Γ—H100 at batch 8 / imgsz 1280
82
- - Train & val box/cls losses plus per-epoch detection metrics were tracked throughout; DDP job with additional train-batch scalars for monitoring
83
 
84
- ## Intended use
85
 
86
- - Face **detection** (boxes) for privacy blur or similar downstream pipelines
87
- - Benchmarking YOLO26-scale face detectors on WIDER FACE-style data
 
88
 
89
- ## Limitations
90
 
91
- - Domain shift is expected outside WIDER FACE-like photos (extreme motion blur, unusual viewpoints, etc.)
92
- - Not a face recognition / re-identification model
93
- - Ultralytics stack is **AGPL-3.0** β€” review [license terms](https://www.ultralytics.com/license) before commercial redistribution
 
94
 
95
  ## Acknowledgements
96
 
 
10
  - object-detection
11
  - face-detection
12
  - widerface
13
+ - onnx
14
  pipeline_tag: object-detection
15
  ---
16
 
17
+ # YOLO26l face detector (WiderFace)
18
 
19
+ Single-class **face** detector: [Ultralytics YOLO26l](https://docs.ultralytics.com/models/yolo26/) fine-tuned on [WIDER FACE](http://shuoyang1213.me/WIDERFACE/).
20
 
21
+ | | |
22
+ |---|---|
23
+ | Classes | `face` (`0`) |
24
+ | Params | ~24.7M (fused) |
25
+ | Weights | `best.pt` β‰ˆ 151 MB |
26
+ | Train size | 1280 |
27
+ | Ultralytics | 8.4.114+ (YOLO26) |
28
+ | License | AGPL-3.0 |
29
 
30
+ > Base: [YOLO26 docs](https://docs.ultralytics.com/models/yolo26/) Β· Dataset: [WIDER FACE](http://shuoyang1213.me/WIDERFACE/)
 
31
 
32
+ ## Examples (val images)
33
 
34
+ ![Crowd / parade example](assets/pred_01.jpg)
35
+ ![Marching band example](assets/pred_02.jpg)
36
+ ![Concert example](assets/pred_03.jpg)
37
+ ![Parade example](assets/pred_04.jpg)
38
 
39
  ## Quick start
40
 
41
  ```bash
42
+ pip install "ultralytics>=8.4.0" huggingface_hub
 
43
  ```
44
 
45
  ```python
46
+ from huggingface_hub import hf_hub_download
47
  from ultralytics import YOLO
48
 
49
+ weights = hf_hub_download("uralman/yolo26l-widerface", "best.pt")
50
+ model = YOLO(weights)
51
+
52
+ results = model.predict(
53
+ "image.jpg",
54
+ imgsz=1280, # match training
55
+ conf=0.25, # lower (e.g. 0.15) for recall; raise for fewer FPs
56
+ iou=0.7,
57
+ max_det=300,
58
+ )
59
+ for r in results:
60
+ print(r.boxes.xyxy, r.boxes.conf) # face boxes
61
+ r.save("out.jpg")
62
  ```
63
 
64
+ ### Recommended defaults
65
+
66
+ | Setting | Value | Notes |
67
+ |---------|------:|-------|
68
+ | `imgsz` | **1280** | Trained at 1280; smaller sizes are faster but can miss tiny faces |
69
+ | `conf` | 0.25 | Start here; try 0.15–0.35 per domain |
70
+ | `iou` | 0.7 | NMS IoU |
71
+ | `max_det` | 300 | Crowds / parades need headroom |
72
+
73
+ Approximate latency (PyTorch, `imgsz=1280`, conf=0.25): **~14 ms/image on NVIDIA H100** (single image, warmed). Expect slower on smaller GPUs / CPU.
74
+
75
+ ## When to use this vs nano face models
76
+
77
+ - Prefer this **L** checkpoint when you care about **small / crowded faces** and can afford ~25M params / ~150MB.
78
+ - Prefer a **nano** face YOLO when you need max FPS on edge or CPU and faces are relatively large in frame.
79
+
80
+ ## Validation metrics
81
+
82
+ Ultralytics COCO-style box metrics on the **YOLO-formatted WIDER FACE val** split used in this run (~3.2k images). Peak by **mAP50-95** (epoch 71; training stopped ~epoch 73):
83
+
84
+ | Metric | Best |
85
+ |--------|-----:|
86
+ | Precision | 0.896 |
87
+ | Recall | 0.725 |
88
+ | **mAP50** | **0.801** |
89
+ | **mAP50-95** | **0.455** |
90
+
91
+ **Not** the official WIDER FACE Easy/Medium/Hard protocol. Numbers depend on label conversion, `imgsz`, and NMS β€” use them to reproduce *this* setup, not as a leaderboard claim.
92
 
93
+ ## Training (short)
94
 
95
  | Item | Value |
96
  |------|-------|
97
+ | Base | Ultralytics `yolo26l.pt` |
98
+ | Data | WIDER FACE β†’ YOLO labels (~12.9k train / ~3.2k val), 1 class |
99
+ | Setup | imgsz 1280, batch 8, AMP, cosine LR, mosaic + multi-scale |
100
+ | Hardware | 2Γ— H100, DDP |
101
+ | Stop | Early (~73 / 200) near plateau |
 
 
 
 
102
 
103
+ ## Files
 
 
104
 
105
+ | File | Description |
106
+ |------|-------------|
107
+ | `best.pt` | Ultralytics PyTorch weights |
108
+ | `model.onnx` | ONNX export (`imgsz=1280`, dynamic) |
109
+ | `assets/pred_*.jpg` | Example predictions on WIDER FACE val |
 
110
 
111
+ ### ONNX
112
 
113
+ ```bash
114
+ pip install onnxruntime # or onnxruntime-gpu
115
+ ```
116
 
117
+ ```python
118
+ from huggingface_hub import hf_hub_download
119
+ from ultralytics import YOLO
120
 
121
+ onnx_path = hf_hub_download("uralman/yolo26l-widerface", "model.onnx")
122
+ model = YOLO(onnx_path)
123
+ model.predict("image.jpg", imgsz=1280, conf=0.25)
124
+ ```
125
 
126
+ Or export yourself from `best.pt`:
127
 
128
+ ```python
129
+ YOLO("best.pt").export(format="onnx", imgsz=1280, dynamic=True, simplify=True)
130
+ ```
131
 
132
+ ## Limitations & ethics
133
 
134
+ - Face **detection only** (boxes) β€” not recognition / identity.
135
+ - Domain shift expected outside WIDER FACE-like photos (strong blur, unusual cameras, etc.).
136
+ - False positives/negatives can affect privacy pipelines; validate on your data before production.
137
+ - Ultralytics / YOLO26 are **AGPL-3.0** β€” see [license](https://www.ultralytics.com/license).
138
 
139
  ## Acknowledgements
140