Skip to content

Roy72/Sportsball_recognizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sports Ball Recognizer

Data Overview

Total of 3364 images of 19 different types of sports ball has been scraped. data folder contains the datapath. An image classification model from data collection, cleaning, model training, deployment and API integration.
The goal of this project is to classify 19 different types of Sports Ball are played in different sports all over the world.
The types are following:

  1. Soccer Ball
  2. American Football
  3. Tennis Ball
  4. Base Ball
  5. Volleyball
  6. Bowling Ball
  7. Golf Ball
  8. Beach Ball
  9. Pool Ball
  10. Hockey Puck
  11. Badminton
  12. Water Polo
  13. Squash
  14. Wiffleball
  15. Cricket Ball
  16. Sepak Takraw
  17. Table Tennis Ball
  18. taqiyah cap
  19. Basket Ball
  20. Lawn Bowls

Build From Sources

Clone the repo

git clone https://github.com/Roy72/Sportsball_recognizer.git

Dataset Preparation

Data Collection: Downloaded from DuckDuckGo using term name
DataLoader: Used fastai DataBlock API to set up the DataLoader.
Data Augmentation: fastai provides default data augmentation which operates in GPU.
Details can be found in notebooks\README.md, where data_prep.ipynb can be found.

Training and Data Cleaning

Training: Fine-tuned a resnet34 model for 5 epochs (1 time) & 2 epochs (2 times) and got upto ~98% accuracy.
Data Cleaning: This part took the highest time. Since I collected data from browser, there were many noises. Also, there were images that contained. I cleaned and updated data using fastai ImageClassifierCleaner. I cleaned the data each time after training or finetuning, except for the last time which was the final iteration of the model.
Confusion Matrix: This matrix shows the how much the model can accurately predict the images. After training the final model confusion matrix seems fine.

Deatils can be found in notebooks\README.md,where training_and_data_cleaning.ipynb can be found.

Model Deployment

I deployed to model to HuggingFace Spaces Gradio App. The implementation can be found in deployment folder or here.

For Lwan Bowls

For Poolball

For Cricket Ball

For Football

API integration with GitHub Pages

The deployed model API is integrated here in GitHub Pages Website. Implementation and other details can be found in docs folder.

Thanks for observing my project on SprotsBall Recognizer. For any kind of query and suggestion contact with my mail address : anik.roya11@gmail.com