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.
the aim of this project is to:
- read .mp4 video,
- detect the different players, referees, and the singular football present in a video using YOLO,
- train the model to improve its performance and accuracy using Jupyter (model is saved as best.pt),
- assign players to their respective teams based on the cluster analysis performed on their t-shirts using k-means,
- interpolate ball position when ball is not detected in frame,
- calculate each teams' acquisition percentage in real time by detecting who is in current possession of the ball, and
- save output video as an .mp4 video file.
as the model (best.pt) is over 100 MB, it has been uploaded via drive as it is too large for github. :(
a comparison between the before and after, respectively:
demonstration before and after video
project is inspired by: https://www.youtube.com/watch?v=neBZ6huolkg&t=13139s