Find Your Soccer Player is a comprehensive web-based platform for soccer scouting. It provides a powerful tool for fans, scouts and agents to find, shortlist, and analyze soccer players from the five major European leagues. The application offers both a web interface and an API for image classification.
In the data folder (within app), you will find a Jupyter notebook titled "Football players preprocessing". This notebook performs the initial preparation of data for the 2022-2023 soccer season from the five major European leagues.
The data is enriched with player information from two sources:
- Kaggle (player performance statistics)
- Transfer Market (player transfer and valuation data)
The notebook processes this data and generates the necessary files that will be used throughout this project, such as player statistics, market value, and player radar features.
Ensure you have Docker and Docker Compose installed on your machine.
-
Clone the Repository
First, clone the project from GitHub:
git clone https://github.com/danielbehargithub/Find-your-Soccer-Player.git
-
Navigate to the Project Directory
Change your working directory to the
Find-your-Soccer-Playerfolder:cd Find-your-Soccer-Player -
Shut Down Any Previous Docker Containers
If any existing containers are running, stop them with:
docker-compose down
-
Build and Start the Containers
Use Docker Compose to build and run the application in detached mode:
docker-compose up --build -d
-
Load Team Data
After the containers are up and running, you need to load the team data into the MongoDB database. Run the following command to load the teams:
docker exec -it flask_app python app/load_teams.py
Now, the system is ready for use!
The Find Your Soccer Player web application is a platform built using Flask for soccer scouting. It has different types of user roles: viewers, scouts, and agents. The following functionalities are available:
- Viewer: Can explore players based on various criteria and discover players for entertainment or professional purposes.
- Scout: Can shortlist players, add notes, and communicate with agents regarding potential transfers.
- Agent: Can manage a list of players they represent and engage with scouts for potential deals.
- Player Search: Scouts and viewers can search for players by name or custom parameters (such as budget, citizenship, height, and position).
- Shortlisting: Scouts can add players to a personal shortlist and view important statistics.
- Agent Communication: Scouts can chat with agents directly within the platform to discuss player transfers.
- Player Comparison: Compare players using detailed radar charts that visually represent key performance metrics.
- Custom Search: Allows scouts to filter players based on detailed parameters like market value, preferred foot, and physical attributes.
In addition to the web interface, the platform includes an API that supports uploading images and performing image classification using an external image recognition service.
-
Image Upload and Classification:
-
You can upload an image of a soccer player, and the system will classify the image using an image recognition API (such as Imagga or similar services).
-
This API supports both synchronous and asynchronous upload modes.
-
Endpoint:
/upload_image(for synchronous) and/async_upload(for asynchronous) -
Method: POST
-
Parameters:
image(file): The image file to classify.
-
Response: Returns the classification result along with the confidence score.
-
-
Get Classification Result:
-
If the asynchronous upload option is chosen, the classification result can be fetched using the request ID.
-
Endpoint:
/result/<request_id> -
Method: GET
-
Response: The classification status and result.
-
- Backend: Flask, MongoDB for data storage, and Imagga API for image classification.
- Frontend: HTML templates with Bootstrap and JavaScript for dynamic functionalities.
- Docker: The application is containerized using Docker, with both the web app and API running in separate containers.
Unit tests are available in the tests folder. To run the tests, use the following command inside the Docker container:
docker-compose run testThis will execute all the unit tests and output the results.