This project is designed to analyze soccer videos by tracking player and ball movements, estimating camera movements, transforming views, and calculating speed and distance metrics. The output is an annotated video with detailed information about player positions, ball possession, and other metrics.
-
Clone the repository:
git clone https://github.com/yourusername/Soccer_Analysis.git cd Soccer_Analysis -
Install the required dependencies:
pip install -r requirements.txt
-
Set up the environment variables in the .env file.
-
Place your input video in the input_videos directory.
-
Run the main script:
python main.py
-
The output video with annotations will be saved in the [output_videos] directory.
- Trackers: Tracks the objects (players and ball) in the video.
- Camera Movement Estimator: Estimates the camera movement and adjusts the object positions accordingly.
- View Transformer: Transforms the view to a top-down perspective.
- Speed and Distance Estimator: Calculates the speed and distance covered by the players.
- Team Assigner: Assigns team colors to the players.
- Player Ball Assigner: Determines which player has possession of the ball.
The training scripts and data are located in the [training]directory. You can use the provided Jupyter notebooks to train your models.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or issues, please open an issue on the GitHub repository.
