Garbage Classifier using Transfer Learning: ML-powered REST API for classifying waste. Built with FastAPI, TensorFlow, and Transfer Learning on NASNet.
Use the live web version here : Garbage Classifier - Web App
To reimplement this on your own and get the models, I have made a complete end-to-end guide & instructions here: CNN & Transfer Learning
- Clone the repository to your local machine (or) download as a .zip file and extract it :
git clone https://github.com/g-wtham/garbage-classifier-fastapi/
cd garbage-classifier-fastapi
-
Install the required dependencies using :
pip install -r requirements.txt -
Change the fetch url in
/static/script.jsfile to127.0.0.1:8000/predictto start the FastAPI local development server. Open themain.pyfile in your code editor, runuvicorn main:app --reloadin the terminal. -
Run the local dev server
localhost:8000orlocalhost:8000/static/index.html. Done :)
And right there is your web interface!
Now you can upload your images and get the predictions! Colab file is also given which is used for training the model.
- NasNet Mobile - Last 15 layers are trained on the
TrashNet datasetand obtained 99.88% accuracy after 30 epochs!

