Downloads · 30 days
248
30% of all-time downloads
gianpaj/football-players-detection-1
football-players-detection-1 is a object detection model from gianpaj. Use it when you need objects located in an image. It is set up for ultralytics. The card lists the license as agpl-3.0.
A YOLOv8x object-detection model fine-tuned to detect the four key entities in football (soccer) broadcast footage: ball, goalkeeper, player, referee. It is the detection backbone of a football-analysis pipeline (trac…
Downloads · 30 days
248
30% of all-time downloads
All-time downloads
834
Public
Repo size
280 MB
Likes
1
Public
Click a slice to open those files.
.pt273 MB · 98%
From the Hugging Face model README
football_yolo-2)A YOLOv8x object-detection model fine-tuned to detect the four key entities in football (soccer) broadcast footage: ball, goalkeeper, player, referee. It is the detection backbone of a football-analysis pipeline (tracking, team assignment, ball possession, speed/distance estimation).
Code / project repository: github.com/gianpaj/football_analysis_yolo — the full pipeline that consumes these weights (detection → ByteTrack tracking → team assignment → possession → speed/distance), plus training and usage instructions.
yolov8x.pt (Ultralytics, COCO-pretrained), fine-tunedball, goalkeeper, player, refereeweights/best.pt — best checkpoint by validation mAP50-95 (recommended for inference)weights/last.pt — final epoch (100) checkpointargs.yaml — full training configurationresults.csv / results.png — per-epoch training/validation curvesconfusion_matrix*.png, Box*_curve.png — evaluation plotsplayer. (Some downstream pipelines deliberately remap goalkeeper → player.)Following Mitchell et al., 2018: this model detects generic on-pitch roles and does not perform person identification, biometric recognition, or any demographic inference. Detection quality may vary with skin tone, kit color, camera quality, and broadcast style due to the narrow single-dataset training distribution — do not assume uniform accuracy across all footage. It is intended for aggregate sports analytics, not for surveillance or individual-tracking use cases. Any latency-sensitive or wagering-related downstream use should account for the ball-detection weakness above.
football-players-detection-3zvbc, version 1 (workspace roboflow-jvuqo)ball, goalkeeper, player, referee (nc: 4)download-model.py (Roboflow API).Fine-tuned from yolov8x.pt for 100 epochs on a single NVIDIA GeForce RTX 4060 Ti (16 GB).
| Hyperparameter | Value |
|---|---|
| Base weights | yolov8x.pt (pretrained) |
| Epochs | 100 |
| Batch size | 16 |
| Image size | 640 |
| Optimizer | auto (SGD-family, Ultralytics default) |
Initial LR (lr0) | 0.01 |
Final LR factor (lrf) | 0.01 |
| Momentum | 0.937 |
| Weight decay | 0.0005 |
| Warmup epochs | 3 |
| Mixed precision (AMP) | enabled |
| Loss gains | box 7.5 / cls 0.5 / dfl 1.5 |
| Augmentation | mosaic 1.0 (closed last 10 epochs), fliplr 0.5, HSV h/s/v 0.015/0.7/0.4, translate 0.1, scale 0.5, erasing 0.4, randaugment |
| Seed / deterministic | 0 / true |
| Total wall-clock | ~3,163 s (~53 min) |
The full configuration is in args.yaml. best.pt is the checkpoint with the highest validation mAP50-95 (around epoch 42).
Evaluated on the validation split (38 images, 905 instances) with best.pt. Speed: 0.1 ms preprocess, 8.7 ms inference, 0.3 ms postprocess per image on an RTX 4060 Ti.
| Class | Images | Instances | Precision | Recall | mAP50 | mAP50-95 |
|---|---|---|---|---|---|---|
| all | 38 | 905 | 0.930 | 0.761 | 0.834 | 0.575 |
| ball | 35 | 35 | 0.794 | 0.400 | 0.420 | 0.188 |
| goalkeeper | 27 | 27 | 0.982 | 0.778 | 0.963 | 0.717 |
| player | 38 | 754 | 0.975 | 0.969 | 0.991 | 0.745 |
| referee | 38 | 89 | 0.969 | 0.899 | 0.961 | 0.650 |
Summary: Player, referee, and goalkeeper detection are strong (mAP50 ≥ 0.96). The overall averages are dragged down almost entirely by the ball class. See Limitations.
For the complete analysis pipeline (tracking, team assignment, possession, speed/distance) see the GitHub repo: github.com/gianpaj/football_analysis_yolo. Standalone detection with these weights:
from ultralytics import YOLO
model = YOLO("weights/best.pt")
# Single image / frame
results = model.predict("frame.jpg", conf=0.1) # low conf helps ball recall
for r in results:
print(r.boxes.xyxy, r.boxes.cls, r.boxes.conf)
# Video
results = model.predict("match.mp4", conf=0.1, stream=True)
Tip: a low confidence threshold (
conf=0.1) is recommended to recover more (weak) ball detections; pair it with tracking/interpolation to filter false positives and bridge missed ball frames.
This model is a fine-tune of Ultralytics YOLOv8 and is therefore distributed under the AGPL-3.0 license (the license of the base model and framework). If you require a non-AGPL/commercial license for the YOLOv8 weights, see Ultralytics licensing.
The training dataset (football-players-detection-3zvbc) is licensed CC BY 4.0 by its Roboflow authors; attribution is due to them for the data.
Ultralytics YOLOv8
@software{yolov8_ultralytics,
author = {Glenn Jocher and Ayush Chaurasia and Jing Qiu},
title = {Ultralytics YOLOv8},
version = {8.0.0},
year = {2023},
url = {https://github.com/ultralytics/ultralytics},
license = {AGPL-3.0}
}
Dataset
@misc{football-players-detection-3zvbc,
title = {Football Players Detection Dataset},
author = {Roboflow (roboflow-jvuqo)},
year = {2024},
url = {https://universe.roboflow.com/roboflow-jvuqo/football-players-detection-3zvbc},
note = {CC BY 4.0}
}