My first hands-on deep learning classifier using data from imagenette
and google images and building a small API of it.
- Data collection from
imagenette
and google images - Load and Train on raw data with
resnet34
architecture - Data cleaning by removing similar images and
from_toplosses
- Unfreeze model and train on cleaned images dataset
- Data Interpretation by
confusion_matrix
andfrom_toplosses
- Comparison with
resnet50
architecture - Prediction on test set and exporting the trained model
- Building a small API by taking above exported model
-meme_classifier.ipynb
: notebook used for performing above steps, using fastai
-export.pkl
: Exported model after training (84 MB file)
-meme_api.py
: A small Starlette API which accepts file upload as well as image URL and runs them against pre-calculated model to give prediction.
Local Usage:
uvicorn meme_api:app
The model is deployed on Render at https://meme-classifier.onrender.com.
Template of the same can can be found here.
Input Image (upload): data/Unknown.jpg
Prediction: http://127.0.0.1:8000/upload
Input Image (URL): https://upload.wikimedia.org/wikipedia/commons/thumb/0/04/Greenland_467_%2835130903436%29.jpg/640px-Greenland_467_%2835130903436%29.jpg