The goal of this project is to detect and track players, referees, and footballs in a video using YOLO, a leading AI object detection model. I also trained the model to improve its performance. Additionally, we assigned players to teams based on the colors of their t-shirts using Kmeans for pixel segmentation and clustering. We also assigned the ball to a player during gameplay. With this information, we measured a team's ball acquisition percentage throughout the match. Furthermore, we implemented perspective transformation to convert the scene into a 2D graphic,, allowing us to measure a player's movement in meters rather than pixels.
- Object Detection: Detect and track players, referees, and footballs using YOLO.
- Player-Team Assignment: Assign players to teams based on t-shirt colors using KMeans clustering.
- Ball Assignment: Assign the ball to a player during gameplay.
- Ball Possession Analysis: Measure team ball possession throughout the match.
- Movement Analysis: Track player movements and measure distances in meters using perspective transformation.
- Programming Language: Python
- Framework: TensorFlow/PyTorch (for YOLO)
- Libraries: OpenCV, NumPy, scikit-learn, matplotlib, supervision, ultralytics
- Object Detection Model: YOLO (You Only Look Once)
- Clustering Algorithm: KMeans (for team assignment)
- Transformation: Perspective transformation (for real-world measurement)
output3.1.mp4
-
Challenges:
- Distinguishing players with similar t-shirt colors.
- Tracking Players in complex game scenarios.
-
Potential Improvements:
- Training the YOLO with more Data (I only use a small DataSet)
- Improve goalkepper team asigner
- Use more advanced clustering techniques for better player-team assignment.