Member-only story
Into football analytics: How to track football players using Yolov8
Introduction
In this post, I will show how I detect and track players using Yolov8 and openCV from video clip, and turn the detections to the bird’s-eye view as shown above.
Football video dataset
For this project, all videos and tests were conducted using a dataset from a Kaggle competition, featuring clips from Bundesliga matches. This dataset, accessible here.
Object detection
The initial phase involves loading the video to identify the players. For this, I utilized the pre-trained Yolov8 weights, applying ultralytics module. This approach focused specifically on detections categorized as ‘person’. To highlight the detected players, bounding boxes were drawn around them.
Further work could be done by training a custom model to detect football players as well as other interesting objects like the referee or the football.

