A simple, yet effective way to analyze players and teams in various sports settings using computer vision and machine learning.
Make sure you have OpenCV 4 installed as well as CMake.
To set up the environment, build the Singularity image using the following command:
cd OpenCV_Environment
sudo singularity build cv_sport_project.sif opencv_env.def
Clone the repository and run the following commands:
mkdir build
cd build
cmake ..
cmake --build .
For the singularity version:
singularity exec ../OpenCV_Environment/cv_sport_project.sif bash ../OpenCV_Environment/build_command.sh
NOTE: The singularity command both builds and runs the program.
To run the program, run the following command from inside the build directory:
./main ../models/best.onnx <path to images folder> <path to output folder>
To modify the singularity runtime arguments, edit the build_command.sh file.
Enrico D'Alberton (https://github.com/enricopro) - Player classification
Federico Gelain (https://github.com/FedericoGelain) - Playing Field detection and segmentation
Pietro Girotto (https://github.com/gp-1108) - Player segmentation