=====================================================
๐ An end-to-end computer vision pipeline for soccer player detection, multi-object tracking and ROI-based behavior analysis from broadcast videos.
Developed for the Artificial Vision (MSc in Computer Engineering) course at the University of Salerno, and evaluated on the SoccerNet 2023 Tracking dataset using HOTAโ.โ and normalized MAE (nMAE) metrics.
Demonstrates practical experience in deep learning, multi-object tracking, re-identification, camera motion compensation and performance-driven experimental design.
behavior_Screen.Recording.2025-12-22.at.13.32.09_clip.mp4
This project implements a complete pipeline that performs:
- โฝ Player, referee and linesman detection
- ๐ Multi-object tracking with ID consistency
- ๐ง Behavior analysis (number of players inside predefined ROIs)
- ๐ Evaluation using HOTAโ.โ (tracking) and nMAE (behavior)
- ๐ Final ranking metric: PTBS = HOTAโ.โ + nMAE
The system was tested on the official SoccerNet Tracking 2023 dataset and evaluated using the simulation tool provided by the course instructors.
Full technical details are available in:
๐ 1 - Documentazione_Artificial_Vision_Cirillo_Fasolino.pdf
All code comments and internal documentation are written in Italian, as the project was developed during a group exam at the University of Salerno (Italy).
Despite this, the codebase follows international best practices, with clear method names and class structures that make it easily understandable for global developers and recruiters.
The final pipeline consists of:
- YOLO12m (fine-tuned on SoccerNet) for detection
- Soccer pitch mask filtering (color-based with safety threshold)
- Bot SORT tracker (tuned)
- Camera Motion Compensation (sparse optical flow)
- Re-identification using Omni-Scale Network (MSMT17 pretrained)
- ROI-based behavior analysis
- Output generation in official contest format
CodeVideo โ YOLO Detection โ Pitch Mask Filtering โ Bot SORT Tracking
โ Tracking Output (.txt)
โ ROI Counting โ Behavior Output (.txt)
The final inference pipeline consumes < 500MB RAM, making it deployable on mid-range devices.
- YOLOv8 / YOLO11 / YOLO12 (Ultralytics)
- Final model: YOLO12m fine-tuned on SoccerNet
- Resolution: 1024
- Optimizer: AdamW
- ByteTrack (baseline + tuning)
- Bot SORT (final choice)
- ReID: Omni-Scale Network x0_25
- Camera Motion Compensation
- OpenCV
- Ultralytics
- boxmot
- Optical Flow
- Morphological operators
- HOTAโ.โ = 0.762231
- MAE = 0.184925
- Normalized MAE (nMAE) = 0.981507
PTBS = HOTAโ.โ + nMAE = 1.743739
The system was evaluated using the official simulator provided by the course (not present in this repository).
Code๐ฆ soccer-players-tracking
โโโ ๐ docs
โ โโโ 0 - Contest presentation.pdf
โ โโโ 1 - Documentazione_Artificial_Vision_Cirillo_Fasolino.pdf
โ โโโ 2 - output_simulator.txt
โ
โโโ ๐ scripts
โ โโโ 0 - dataset_download.py
โ โโโ 1 - create_behavior_gt.ipynb
โ โโโ 2 - dataset_conversion.ipynb
โ โโโ 3 - yolo_training.ipynb
โ โโโ 4 - yolo_validation.ipynb
โ โโโ 5 - tracking_pipeline_inference_script.ipynb
โ
โโโ ๐ weights
โ โโโ best_yolo12m_v2.pt
โ
โโโ LICENSE
โโโ README.md
- Conversion from SoccerNet format โ YOLO format
- Removal of ball annotations
- ROI generation
- Behavior ground truth generation
Scripts:
dataset_conversion.ipynbcreate_behaviour_gt.ipynb
- Fine-tuning of YOLO12m
- Validation split created from training set
- Hyperparameter exploration (freeze vs full fine-tuning)
Notebook:
yolo_training.ipynbyolo_validation.ipynb
- ByteTrack tuning
- Switch to Bot SORT
- ReID integration
- Camera Motion Compensation
- ID switch reduction analysis
Full pipeline available in:
Codetracking_pipeline_inference_script.ipynb
Outputs:
tracking_K_XX.txtbehavior_K_XX.txt- Annotated output videos
Developed as a Project Work for:
Artificial Vision โ MSc in Computer Engineering
University of Salerno
Academic Year 2025/2026
All internal documentation is written in Italian, as required by the course.
- Over-tracking and ID fragmentation
- Camera panning & zoom effects
- False detections outside the pitch
- Appearance similarity among players
- ROI-based counting robustness
- Semantic segmentation-based pitch mask
- Jersey number recognition for long-term re-identification
- Player Attribute Recognition (PAR)
- Further tracker optimization
- More robust handling of adverse weather conditions (e.g., snow)
This project highlights:
- Applied deep learning
- Multi-object tracking optimization
- Experimental methodology
- Metric-driven development
- End-to-end system design
If you find it interesting, feel free to โญ the repository.
โ๏ธ Got feedback or want to contribute? Feel free to open an Issue or submit a Pull Request!
Soccer Player Tracking, SoccerNet Tracking 2023, Multi-Object Tracking, MOT Computer Vision, YOLO12 Fine-Tuning, YOLO Soccer Detection, Bot SORT Tracker, ByteTrack Tracking, Player Re-Identification, ReID Computer Vision, Camera Motion Compensation, Optical Flow Tracking, Sports Video Analytics, Soccer Video Understanding, ROI Behavior Analysis, HOTA Metric, HOTA 0.5 Evaluation, Detection and Association Accuracy, Normalized MAE, PTBS Score, Deep Learning for Sports, Broadcast Video Analysis, Real-Time Object Tracking, Ultralytics YOLO, Computer Vision MSc Project, Artificial Vision Project, Python Computer Vision, Soccer Analytics AI, End-to-End Vision Pipeline, University of Salerno Project
This project is licensed under the MIT License, a permissive open-source license that allows anyone to use, modify, and distribute the software freely, as long as credit is given and the original license is included.
In plain terms: use it, build on it, just donโt blame us if something breaks.
โญ Like what you see? Consider giving the project a star!