Link to the Demo
Research and development of AI models for soccer analytics and insights. This project aims to provide tools for detecting players, goalkeepers, referees, and the ball in soccer videos. It also includes features for tracking player movements, classifying players into teams, and visualizing player positions on the soccer field.
- Developed and integrated Soccer AI using YOLOv8, achieving over 95% precision and 85% recall in player detection, and 99% precision and recall in keypoint detection for real-time soccer game analysis.
We don't have a Python package yet, but you can install from the source in a Python>=3.8 environment. Follow the steps below:
pip install https://github.com/A7medM0sta/soccer.git
pip install -r requirements.txt
./setup.shDetects the soccer field boundaries and key points in the video. Useful for identifying and visualizing the layout of the soccer pitch.
python main.py --source_video_path data/2e57b9_0.mp4 --target_video_path data/2e57b9_0-pitch-detection.mp4 --device mps --mode PITCH_DETECTIONDetects players, goalkeepers, referees, and the ball in the video. Essential for identifying and tracking the presence of players and other entities on the field.
python main.py --source_video_path data/2e57b9_0.mp4 --target_video_path data/2e57b9_0-player-detection.mp4 --device mps --mode PLAYER_DETECTIONDetects the ball in the video frames and tracks its position. Useful for following ball movements throughout the match.
python main.py --source_video_path data/2e57b9_0.mp4 --target_video_path data/2e57b9_0-ball-detection.mp4 --device mps --mode BALL_DETECTIONTracks players across video frames, maintaining consistent identification. Useful for following player movements and positions throughout the match.
python main.py --source_video_path data/2e57b9_0.mp4 --target_video_path data/2e57b9_0-player-tracking.mp4 --device mps --mode PLAYER_TRACKINGClassifies detected players into their respective teams based on their visual features. Helps differentiate between players of different teams for analysis and visualization.
python main.py --source_video_path data/2e57b9_0.mp4 --target_video_path data/2e57b9_0-team-classification.mp4 --device mps --mode TEAM_CLASSIFICATIONCombines pitch detection, player detection, tracking, and team classification to generate a radar-like visualization of player positions on the soccer field. Provides a comprehensive overview of player movements and team formations.
python main.py --source_video_path data/2e57b9_0.mp4 --target_video_path data/2e57b9_0-radar.mp4 --device mps --mode RADAR- http://roboflow.com
- https://github.com/roboflow/notebooks/blob/main/notebooks/train-yolov8-object-detection-on-custom-dataset.ipynb
- https://github.com/roboflow/notebooks
- https://blog.roboflow.com/camera-calibration-sports-computer-vision/*
- https://blog.roboflow.com/tracking-ball-sports-computer-vision/











