Instructions to use Xulee-0806/YOLO-head-detection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use Xulee-0806/YOLO-head-detection with ultralytics:
from huggingface_hub import hf_hub_download from ultralytics import YOLO # pick the weights file from this repo's "Files and versions" tab weights = hf_hub_download("Xulee-0806/YOLO-head-detection", "<weights>.pt") model = YOLO(weights) source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
Commit Β·
082b75a
0
Parent(s):
Duplicate from wesjos/YOLO-head-detection
Browse filesCo-authored-by: wesjos <wesjos@users.noreply.huggingface.co>
- .gitattributes +37 -0
- 11m-head.pt +3 -0
- 11n-head.pt +3 -0
- 11s-head.pt +3 -0
- 11s-relu-head.pt +3 -0
- README.md +92 -0
- assets/bus_11m.jpg +3 -0
- assets/friends_11n.jpg +0 -0
- assets/friends_6models.jpg +3 -0
- v8m-head.pt +3 -0
- v8n-head.pt +3 -0
- v8s-head.pt +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
assets/bus_11m.jpg filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
assets/friends_6models.jpg filter=lfs diff=lfs merge=lfs -text
|
11m-head.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:042b061a3ebfee7b5859685a51df9e014d096325562ad5e675f315245a14e03e
|
| 3 |
+
size 40510124
|
11n-head.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3e77df23ad6ebcc485392ccb1326d27b3d64e97c8ca70defcb7c80278ed06286
|
| 3 |
+
size 5467482
|
11s-head.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a845d4a7fa2ceadc1ada7b0aec59e684fa53965d3628edd6fb6e517100ef1aa5
|
| 3 |
+
size 19172243
|
11s-relu-head.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d56b274dfa1ff9e62cfd53a0ec11042a7e710a3c9e741582f273bfddb9c74144
|
| 3 |
+
size 19172634
|
README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: ultralytics
|
| 3 |
+
pipeline_tag: object-detection
|
| 4 |
+
tags:
|
| 5 |
+
- object-detection
|
| 6 |
+
- yolo
|
| 7 |
+
- yolov8
|
| 8 |
+
- yolo11
|
| 9 |
+
- head-detection
|
| 10 |
+
- person-detection
|
| 11 |
+
- ultralytics
|
| 12 |
+
license: agpl-3.0
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# YOLO Head Detection
|
| 16 |
+
> Note: This is not a face detection model. Models trained on camera datasets are used for crowd counting, including two angles: one is a top-down view and the other is an oblique view camera.
|
| 17 |
+
A collection of **seven YOLO checkpoints** trained to detect **human heads** in images β
|
| 18 |
+
useful for crowd counting, privacy blurring, and as a first stage before face recognition.
|
| 19 |
+
|
| 20 |
+
Trained on a dataset of **15,000 images**.
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
### π Recommended: `11n-head.pt`
|
| 24 |
+
|
| 25 |
+
**`11n-head.pt` is the suggested default for most users**
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
|
| 29 |
+
Street scene, `11m-head.pt` β four people are visible, and two of the heads are boxed:
|
| 30 |
+
|
| 31 |
+

|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
### Which one should you use?
|
| 35 |
+
|
| 36 |
+
- **Default / best overall** β `11n-head.pt` (see above).
|
| 37 |
+
- **Fastest on a small model** β `v8n-head.pt` (93 FPS, 6.2 MB).
|
| 38 |
+
- **Best balance** β `v8s-head.pt` (90 FPS, 22.5 MB, and **zero false boxes** on our negative test).
|
| 39 |
+
- **Highest recall** β `11m-head.pt` / `v8m-head.pt` (more detections, ~50 FPS).
|
| 40 |
+
|
| 41 |
+
Note the pattern: every **YOLOv8** checkpoint we shipped stays silent on a head-free image,
|
| 42 |
+
while the **YOLO11** family tends to emit low-confidence false boxes. If false positives
|
| 43 |
+
cost you more than missed heads, start with `v8s-head.pt`.
|
| 44 |
+
|
| 45 |
+
## π Quick start
|
| 46 |
+
|
| 47 |
+
```bash
|
| 48 |
+
pip install ultralytics
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
```python
|
| 52 |
+
from ultralytics import YOLO
|
| 53 |
+
|
| 54 |
+
# pick any checkpoint from the table above
|
| 55 |
+
model = YOLO("v8s-head.pt")
|
| 56 |
+
|
| 57 |
+
results = model("photo.jpg", conf=0.25, imgsz=640)
|
| 58 |
+
|
| 59 |
+
for box in results[0].boxes:
|
| 60 |
+
x1, y1, x2, y2 = box.xyxy[0].tolist()
|
| 61 |
+
conf = float(box.conf)
|
| 62 |
+
print(f"head @ ({x1:.0f},{y1:.0f})-({x2:.0f},{y2:.0f}) conf={conf:.2f}")
|
| 63 |
+
|
| 64 |
+
results[0].save("annotated.jpg")
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
> π‘ The checkpoints **do not carry class names** β class index `0` is the head class.
|
| 68 |
+
> To get readable labels on plotted boxes, map it yourself:
|
| 69 |
+
> ```python
|
| 70 |
+
> results[0].names = {0: "head"} # visualisation only
|
| 71 |
+
> ```
|
| 72 |
+
|
| 73 |
+
## π Training
|
| 74 |
+
|
| 75 |
+
- **Dataset size**: ~15,000 images
|
| 76 |
+
- **Task**: single-class object detection (human heads)
|
| 77 |
+
- **Label convention**: class index `0`; the checkpoints include no `names` mapping
|
| 78 |
+
- **Framework**: [Ultralytics](https://github.com/ultralytics/ultralytics) β YOLOv8 and YOLO11
|
| 79 |
+
|
| 80 |
+
## π License
|
| 81 |
+
|
| 82 |
+
Released under **AGPL-3.0**, inherited from the Ultralytics framework.
|
| 83 |
+
|
| 84 |
+
## Citation
|
| 85 |
+
|
| 86 |
+
```bibtex
|
| 87 |
+
@misc{yolo-head-detection,
|
| 88 |
+
title = {YOLO Head Detection},
|
| 89 |
+
note = {Seven YOLOv8 / YOLO11 head-detection checkpoints trained on ~15k images},
|
| 90 |
+
year = {2026}
|
| 91 |
+
}
|
| 92 |
+
```
|
assets/bus_11m.jpg
ADDED
|
Git LFS Details
|
assets/friends_11n.jpg
ADDED
|
assets/friends_6models.jpg
ADDED
|
Git LFS Details
|
v8m-head.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ec3b756fc99b6aa3a5fa2f025865888bf24653ee4ccedacd5cd76acc818d43f2
|
| 3 |
+
size 52025554
|
v8n-head.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:72582443abdb4256e1472c8a6739ce8cab9054512fd19611c70e8786b6326d58
|
| 3 |
+
size 6244970
|
v8s-head.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1467b10e30a05be6a05950190e5efe30b50681270cb7baf6115ec96806b25964
|
| 3 |
+
size 22513507
|