Sitemap
LatinXinAI

Global Community of LatinX in AI (LXAI) Professionals, Engineers, Researchers, and Entrepreneurs! Join us at www.latinxinai.org

Into football analytics: How to track football players using Yolov8

5 min readDec 28, 2023

--

Press enter or click to view image in full size
Player tracking in bird’s-eye view

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.

Press enter or click to view image in full size
Original clip from kaggle bundesliga data shootout

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.

Press enter or click to view image in full size
Person detection using yolov8

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.

--

--

LatinXinAI
LatinXinAI

Published in LatinXinAI

Global Community of LatinX in AI (LXAI) Professionals, Engineers, Researchers, and Entrepreneurs! Join us at www.latinxinai.org

Daniel García
Daniel García

Written by Daniel García

Lifetime failure - I write as I learn 🤖

Responses (11)