car_web2 / README2.md
wesam0099's picture
Add README frontmatter
c02215f

🎯 AI-Powered Football Match Analyzer

A real-time system that uses deep learning and computer vision to analyze football matches, track players and the ball, and provide instant insights to support coaches in decision-making.


πŸ“‚ Project Structure

players_detect_project/
β”‚
β”œβ”€β”€ camera_movement_estimator/         # Estimate camera movement
β”œβ”€β”€ development_and_analysis/          # Data cleaning and visual analysis
β”œβ”€β”€ player_ball_assigner/              # Assign ball possession to player
β”œβ”€β”€ speed_and_distance_estimator/      # Calculate player speed and distance
β”œβ”€β”€ stubs/                             # Preprocessed files (Pickle)
β”œβ”€β”€ team_assigner/                     # Detect team for each player
β”œβ”€β”€ trackers/                          # Object tracking logic
β”œβ”€β”€ view_transformer/                  # Convert camera view to top-down
β”œβ”€β”€ best.pt                            # Trained YOLOv8 model weights
β”œβ”€β”€ main.py                            # Main entry to run the full pipeline
└── yolo_inference.py                  # Inference script using YOLOv8

🧠 How It Works

  • Video Input: The system accepts football match videos.
  • YOLOv8 Inference: Detects players, referees, ball, and goalkeeper.
  • Tracking & Assignment:
    • Tracks players and ball movement over time.
    • Assigns ball possession to the nearest player.
    • Assigns team labels and colors.
  • Analytics Modules:
    • Calculates player speed, distance, and performance drops.
    • Detects camera movement to adjust accuracy.
    • Sends real-time alerts to the coach when tactics shift or performance declines.

βœ… Key Features

  • Real-time AI-based decision support for coaches.
  • Precision tracking of players, ball, and game flow.
  • Insights like ball possession %, sprint speed, tactical shifts.
  • Modular design, easily extendable for future improvements.

πŸ§ͺ Model Performance

Class Accuracy
Player 99.4%
Goalkeeper 94.8%
Referee 97.7%
Ball 59.9% ⚠️

Tested on 50 real match clips. Ball detection will be improved with more data.


🚧 Future Plans

  • Improve ball detection accuracy with more diverse data.
  • Add user interface for live visualization.
  • API integration for live camera input.
  • Full match testing in real-world environments.

🀝 Contributors & Support

Built as part of the SDAIA AI League Hackathon, with the goal of empowering sports strategy using AI.