Waste Detection on the browser using TFLite model
February 6, 2024 ยท View on GitHub
As an initiative to solve for environment, this project is an implementation of detecting various categories of waste in real-time by deploying a TF Lite model directly on the browser using the TFJS-TFLite API.
Note: TF Lite Model Maker is now obsolete and is replaced by MediaPipe Model Maker.
Implementation details:
The object detection model was trained on a custom dataset of different categories of waste โ open litter, plastic waste, biodegradable waste, medical waste, and overflowing dustbin.
Steps to run:
-
Clone the repository on your local machine.
-
For static detection, navigate to the directory
cd Static Detection; for real-time detection, navigate to the directorycd Real-time Detection. -
Open your terminal/command prompt and enter the command
py -m http.server(if you have Python installed) to create a local server. -
Open your web browser, and go to
localhost:8000.
Static Detection:

Real-time Detection:

- Try a LIVE demo on CodeSandbox.
- Read the Medium blog for technical details.
- Watch the full demonstration on YouTube.
- The project is featured on Google Dev Library.
References:
- TF Lite Model Maker tutorial: To train a custom object detection TF Lite model.
- TFJS-TFLite Task API: To load the TF Lite model directly on the browser and do inferencing.