This project is an upgraded version of a Smart India Hackathon prototype.
It uses YOLOv8 (Ultralytics) for object detection combined with a Flask backend and a simple frontend
to analyze plate images, estimate food coverage, and assign a "fine" based on leftovers.
- Upload an image of a plate via web UI
- YOLOv8-powered object detection for food & plates
- Calculates coverage % (food area / plate area)
- Assigns plate status (empty, half-full, etc.) with fines 💸
- Results displayed with processed image & detected items list
- JSON API available (for programmatic access)
├── app.py # Flask backend (routes & upload handling)
├── plate_detection.py # YOLOv8 + CV logic for analyzing plates
├── requirements.txt # Dependencies
├── templates/
│ └── index.html # Frontend template (Jinja2)
├── static/
│ ├── style.css # Styling for UI
│ └── outputs/ # Processed images (auto-created)
├── uploads/ # Uploaded images (auto-created)
└── README.md # Documentation
git clone https://github.com/ohnogaurav/plate-monitor.git
cd plate-monitor
python -m venv venv
source venv/bin/activate # On Linux/Mac
venv\Scripts\activate # On Windows
pip install -r requirements.txt
python app.py
By default, app runs at: http://127.0.0.1:5000/
- Go to web UI in browser
- Upload
.jpg
/.jpeg
/.png
file - View processed result with detected items + coverage
Send POST
request with image file:
curl -X POST -F [email protected] http://127.0.0.1:5000/upload -H "Accept: application/json"
Response example:
{
"status": "Plate is half full",
"fine": 35,
"coverage_percent": 47.5,
"detected_items": [
{"label": "plate", "conf": 0.92},
{"label": "spoon", "conf": 0.88}
],
"output_image_url": "/static/outputs/processed_1692628234_test.jpg"
}
- Backend: Flask (Python)
- Computer Vision: YOLOv8 (Ultralytics), OpenCV
- Frontend: HTML, CSS (Jinja2 templating)
- Others: Werkzeug for uploads, REST-style JSON API
Project developed & upgraded by Gaurav Kumar
Originally built during Smart India Hackathon