Computer Vision
Football Player Tracking with YOLO and Team Colors
A Python football-video pipeline combines YOLO detection, jersey-based team colors and ByteTrack IDs to produce annotated match footage for visual analysis.
Illustrative football pipeline combining YOLO detection, appearance-based team grouping and tracking IDs into annotated match video.
The problem
Turning recorded football footage into a useful visual-analysis baseline requires more than detecting people. Players need team labels and tracking IDs, while goalkeepers, referees and the small ball need distinct detection classes. This project connects those components in one configurable video-processing pipeline.
What I built
YOLO detector training for four classes: ball, goalkeeper, player and referee, using a public Roboflow football dataset.
Jersey-based team grouping that adapts Roboflow's team-classification approach, using pretrained SigLIP embeddings, UMAP and two-cluster KMeans.
ByteTrack IDs through Ultralytics tracking, with an alternative BoT-SORT configuration.
Team-colored player ellipses, tracking labels and a triangle marker when the ball is detected.
Hydra configuration for model, tracker and annotation settings, with annotated video output.
The diagram shows the implemented path from recorded video to the overlay. The gallery clip demonstrates team colors and IDs, while the two charts describe detector validation.
Published detector validation
The repository reports a YOLOv12L result on 49 validation images containing 1,174 labeled objects: precision 0.948, recall 0.880, mAP50 0.916 and mAP50-95 0.675. Player mAP50 is 0.994; ball recall is 0.618, making the ball the weaker class. These are published box-detection results, not measurements of tracking identity consistency, team assignment or processing speed. The evaluation was not rerun for this case study.
The outcome
The implementation turns a match recording into an annotated video that can be inspected with team colors and tracking IDs. The public clip and validation plots make the result concrete, while the weaker ball detection identifies a useful target for further model work.
View the public football tracking implementation.
Where this fits
Useful for scouting products, clubs and software teams building a recorded-football analysis feature. Share a permitted sample clip, camera setup and required overlays to scope Computer Vision Model Development.
Working on something similar?
Discuss a similar project