Sports Person Image Classification

This projects can classify images of the following sports persons:

  1. Cristiano Ronaldo
  2. Lionel Messi
  3. Conor McGregor
  4. Khabib
  5. Virat Kohli
  6. Kane Williamson

Demo

https://sports-person-classify.netlify.app/

Screenshot

App Screenshot

Tech Stack

Client: HTML, CSS, JavaScript, Jquery, Bootstrap

Server: Python, Flask

Run Locally

Clone the project

git clone https://github.com/SrijanDas/Sports-person-image-classification.git

Go to the server directory

cd Sports-person-image-classification\server\

Install dependencies

pip install -r requirements.txt

Start the backend server

python app.py

Now the backend server is running. Open frontend\index.html.
Note: Open frontend\js\index.js and change env variable to use the local backend server.

const env = "dev";

That's it 👍. You are ready to go.

Roadmap

  • Data Collection
  • Data Cleaning
  • Model Building, Training and Testing
  • Backend API Building
  • Frontend/UI Building
  • Deployment

Data Collection

Collected the images from google images with the help of Fatkun Batch Download Image

Data Cleaning

Detected faces and eyes from the images with python-opencv and cropped only the faces. Then deleted the unwanted images manually. For more info refer to Jupyter Notebook

Model Building, Training and Testing

Tried different machine learning and deep learning models like SVM, Random Forest, Logistic Regression and CNN. Among those Logistic Regression and CNN gave the best accuray of 87.5% and 86.9% respectively. Finally selected the Logistic Regression model for deployment. For more info check this Jupyter NoteBook

Backend API Building

Build the backend api with python and flask. The backend has a root / url and a /classify_image url

  POST /classify_image/
Parameter Type Description
image_data string Required. Your base64 encoded image

Frontend/UI Building

The frontend was built with HTML, CSS, Javascript, Jquery, Bootstrap.

Deployment

  • Backend API was deployed on heroku
  • Fronted was deployed on netlify

Thank you 😃

portfolio linkedin twitter