Skip to content

Garbage Classifier using Transfer Learning: ML-powered REST API for classifying waste. Built with FastAPI, TensorFlow, and Transfer Learning on NASNet.

Notifications You must be signed in to change notification settings

g-wtham/garbage-classifier-fastapi

Repository files navigation

Garbage Classifier

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

System Architecture:

architecture1 architecture2

Setup Instructions :

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

  1. Install the required dependencies using : pip install -r requirements.txt

  2. Change the fetch url in /static/script.js file to 127.0.0.1:8000/predict to start the FastAPI local development server. Open the main.py file in your code editor, run uvicorn main:app --reload in the terminal.

  3. Run the local dev server localhost:8000 or localhost: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.

Model used :

  1. NasNet Mobile - Last 15 layers are trained on the TrashNet dataset and obtained 99.88% accuracy after 30 epochs!
DEMO_Garbage_Classification_FastAPI.mp4

About

Garbage Classifier using Transfer Learning: ML-powered REST API for classifying waste. Built with FastAPI, TensorFlow, and Transfer Learning on NASNet.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages