Instructions to use wesjos/YOLO-head-detection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use wesjos/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("wesjos/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
YOLO Head Detection
A collection of seven YOLO checkpoints trained to detect human heads in images β useful for crowd counting, privacy blurring, and as a first stage before face recognition.
Trained on a dataset of 15,000 images.
π Recommended: 11n-head.pt
11n-head.pt is the suggested default for most users
Street scene, 11m-head.pt β four people are visible, and two of the heads are boxed:
Which one should you use?
- Default / best overall β
11n-head.pt(see above). - Fastest on a small model β
v8n-head.pt(93 FPS, 6.2 MB). - Best balance β
v8s-head.pt(90 FPS, 22.5 MB, and zero false boxes on our negative test). - Highest recall β
11m-head.pt/v8m-head.pt(more detections, ~50 FPS).
Note the pattern: every YOLOv8 checkpoint we shipped stays silent on a head-free image,
while the YOLO11 family tends to emit low-confidence false boxes. If false positives
cost you more than missed heads, start with v8s-head.pt.
π Quick start
pip install ultralytics
from ultralytics import YOLO
# pick any checkpoint from the table above
model = YOLO("v8s-head.pt")
results = model("photo.jpg", conf=0.25, imgsz=640)
for box in results[0].boxes:
x1, y1, x2, y2 = box.xyxy[0].tolist()
conf = float(box.conf)
print(f"head @ ({x1:.0f},{y1:.0f})-({x2:.0f},{y2:.0f}) conf={conf:.2f}")
results[0].save("annotated.jpg")
π‘ The checkpoints do not carry class names β class index
0is the head class. To get readable labels on plotted boxes, map it yourself:results[0].names = {0: "head"} # visualisation only
π Training
- Dataset size: ~15,000 images
- Task: single-class object detection (human heads)
- Label convention: class index
0; the checkpoints include nonamesmapping - Framework: Ultralytics β YOLOv8 and YOLO11
π License
Released under AGPL-3.0, inherited from the Ultralytics framework.
Citation
@misc{yolo-head-detection,
title = {YOLO Head Detection},
note = {Seven YOLOv8 / YOLO11 head-detection checkpoints trained on ~15k images},
year = {2026}
}
- Downloads last month
- 184

