Skip to content

this computer vision / machine learning project uses YOLO to detect players, referees, and the ball, k-means for pixel segmentation (and to group players by their teams), and optical flow for motion tracking.

Notifications You must be signed in to change notification settings

rosaleensiroosi/field-focus-ai

Repository files navigation

football-analysis-AI-tool

this computer vision / machine learning project uses

  1. YOLO to detect players, referees, and the ball,
  2. k-means for pixel segmentation (and to group players by their teams), and
  3. optical flow for motion tracking.

goals

the aim of this project is to:

  1. read .mp4 video,
  2. detect the different players, referees, and the singular football present in a video using YOLO,
  3. train the model to improve its performance and accuracy using Jupyter (model is saved as best.pt),
  4. assign players to their respective teams based on the cluster analysis performed on their t-shirts using k-means,
  5. interpolate ball position when ball is not detected in frame,
  6. calculate each teams' acquisition percentage in real time by detecting who is in current possession of the ball, and
  7. save output video as an .mp4 video file.

model

as the model (best.pt) is over 100 MB, it has been uploaded via drive as it is too large for github. :(

before and after

a comparison between the before and after, respectively:

Screenshot 2024-05-22 at 4 08 01 PM Screenshot 2024-05-22 at 4 08 17 PM

demonstration

demonstration before and after video

credit

project is inspired by: https://www.youtube.com/watch?v=neBZ6huolkg&t=13139s

About

this computer vision / machine learning project uses YOLO to detect players, referees, and the ball, k-means for pixel segmentation (and to group players by their teams), and optical flow for motion tracking.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages