This project is a comprehensive football analysis system that uses state-of-the-art machine learning, computer vision, and deep learning techniques to track players, calculate ball possession, and analyze player performance in real-time. The system leverages YOLOv8 for object detection, custom-trained models, KMeans clustering for team assignment, and advanced techniques like optical flow and perspective transformation.
Witness the power of this system with real-time statistics overlaid on the video, offering a comprehensive view of player dynamics and team analysis .
- Object Detection: Utilizes YOLOv11 to detect players, referees, and the football in real-time.
- Custom YOLO Model: Fine-tuned and trained a custom object detection model for enhanced accuracy.
- Team Assignment: Uses KMeans clustering to segment player t-shirt colors and automatically assign players to teams.
- Real-Time Ball Possession: Tracks player-ball interactions to calculate real-time ball possession for each team.
- Optical Flow: Measures camera movement between frames to ensure accurate player tracking.
- Perspective Transformation: Converts player movement from pixel distances to real-world meters, providing more meaningful performance data.
- Player Performance Analysis: Calculates player speed and total distance covered during the match.
- Python 3.8 or higher
- OpenCV
- YOLOv11 (Ultralytics)
- NumPy
- SciKit-Learn
- Pandas
- Matplotlib
