Skip to content

danielbehargithub/Find-your-Soccer-Player

Repository files navigation

Find Your Soccer Player

Overview

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.

Data Preprocessing

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.

Setup

Prerequisites

Ensure you have Docker and Docker Compose installed on your machine.

Installation and Running the Project

  1. Clone the Repository

    First, clone the project from GitHub:

    git clone https://github.com/danielbehargithub/Find-your-Soccer-Player.git
  2. Navigate to the Project Directory

    Change your working directory to the Find-your-Soccer-Player folder:

    cd Find-your-Soccer-Player
  3. Shut Down Any Previous Docker Containers

    If any existing containers are running, stop them with:

    docker-compose down
  4. Build and Start the Containers

    Use Docker Compose to build and run the application in detached mode:

    docker-compose up --build -d
  5. 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!


Web Application Functionality

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:

User Roles:

  1. Viewer: Can explore players based on various criteria and discover players for entertainment or professional purposes.
  2. Scout: Can shortlist players, add notes, and communicate with agents regarding potential transfers.
  3. Agent: Can manage a list of players they represent and engage with scouts for potential deals.

Key Features:

  • 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.

API Functionality

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.

Key API Endpoints:

  1. 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.

  2. 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.



Technical Details

  • 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.

Running Tests

Unit tests are available in the tests folder. To run the tests, use the following command inside the Docker container:

docker-compose run test

This will execute all the unit tests and output the results.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •