Football player segmentation project with images from the Kaggle dataset "⚽ Football Player Segmentation ⚽" to use this model to create a Hockey or "all-sports" player segmentation dataset.
Currently we can launch the code via notebooks, the implementation of .py files will follow.
The dataset annotations are loaded from a JSON file, and images along with their corresponding masks are loaded into NumPy arrays. The dataset is then split into training, validation, and test sets. Images are resized for consistency.
The segmentation model is built using the segmentation_models
library with a ResNet model as the backbone. Input images are preprocessed according to the requirements of the chosen backbone. The model is trained on the preprocessed training data.
- Clone the repository to your local machine.
git clone https://github.com/GiraudJules/Player_segmentation.git
- Navigate to the project directory.
cd Player_segmentation
- Create a virtual environment (optional but recommended).
python -m venv venv
source venv/bin/activate
# On Windows, use: venv\Scripts\activate
- Install the required packages.
pip install -r requirements.txt
- Launch Jupyter Notebook to run the provided notebooks.
jupyter notebook
The project requires the following packages:
matplotlib
segmentation_models
Pillow
scikit-learn
opencv-python
tensorflow
numpy
imantics
To replicate the results or build upon this project, start by running the data_exploration.ipynb
notebook for data loading and visualization, followed by the segmentation_model.ipynb
notebook for model training and evaluation.
For any additional details or queries, refer to the provided Jupyter notebooks.