GitHub: click here
The project called MatchVision allows tracking the ball, referees and players, treating players individually by ID and assigning them to a team, displaying ball possession and estimating the camera movement.
Training
The model was trained on Google Colab's servers with T4 GPU (~ 45 mins.)
It uses a custom trained YOLOv5 model.
Benefits:
Structure
The YOLO model detects the bounding boxes of the objects. They get stored in a dictionary along with the tracking ID, the team ID, the position etc.
The team detection is based on KMeans clustering.
To improve the ball highlighting, the ball position gets interpolated with Pandas.
The camera movement gets estimated with optical flow to adjust the object positions.
Input Video Example
Result
The source code was built with Python, mainly using Ultralytics, OpenCV and NumPy.
You have 2 options to run the project:
1) Command Line
2) Frontend
You can upload your own video or use a demo video. Everything is explained in the frontend.
There are no models linked
There are no models linked