Instructions to use ouss100/football-player-detection-yolo8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use ouss100/football-player-detection-yolo8 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("ouss100/football-player-detection-yolo8", "<weights>.pt") model = YOLO(weights) source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
Football Player Detection (YOLO)
1. Overview
This repository contains a YOLO object detection model fine-tuned for football (soccer) match analysis. The model localizes football players in broadcast or tactical camera angles.
2. Model Details
- Architecture: YOLOv8 Nano (
yolov8n.pt) - Task: Object Detection
- Framework: PyTorch / Ultralytics
- Input Resolution: 640x640
- Epochs Trained: 100
3. Dataset
- Format: YOLO txt annotations
- Image Resolution: Resized to 640 pixels on the longest edge during training.
- Augmentations: Mosaic (
1.0), left-right flips (0.5), scaling (0.5), translation (0.1).
4. Training Configuration
Key hyperparameters extracted from args.yaml:
- Epochs: 100
- Batch Size: 16
- Image Size: 640
- Optimizer: Auto
- Initial Learning Rate (
lr0): 0.01 - Final Learning Rate Fraction (
lrf): 0.01 - Momentum: 0.937
- Weight Decay: 0.0005
- NMS IoU Threshold: 0.7
5. Performance
Evaluation metrics at epoch 100:
- Precision: 0.799
- Recall: 0.752
- mAP50: 0.711
- mAP50-95: 0.443
6. Training Visualizations

Training progression showing box, class, and DFL losses alongside precision, recall, and mAP metrics over 100 epochs.

Normalized confusion matrix evaluating true positive predictions and background false negatives.

Precision-Recall (PR) curve demonstrating the trade-off between precision and recall across confidence thresholds.

F1-score curve illustrating optimal confidence thresholds.
7. Installation
pip install ultralytics torch torchvision
8. Usage
Python API
from ultralytics import YOLO
model = YOLO("weights/best.pt")
results = model("football.jpg")
results[0].show()
CLI
yolo task=detect mode=predict model=weights/best.pt source=football.jpg
9. Repository Structure
.
βββ weights/
β βββ best.pt
β βββ last.pt
βββ args.yaml
βββ results.csv
βββ results.png
βββ confusion_matrix.png
βββ confusion_matrix_normalized.png
βββ BoxPR_curve.png
βββ BoxP_curve.png
βββ BoxR_curve.png
βββ BoxF1_curve.png
βββ labels.jpg
βββ val_batch0_pred.jpg
βββ val_batch1_pred.jpg
βββ val_batch2_pred.jpg
- Downloads last month
- 43