Dish Detection Vision Bot

DishBot DishBot DishBot

Project Overview

An automated roommate accountability system that uses computer vision to detect when dishes are left in the sink and identify who left them — then logs and displays the results on a web dashboard. The system combines a custom-trained YOLOv8/NCNN dish detection model with OpenCV face recognition, running on a Raspberry Pi 4 with two cameras.

How It Works

  1. Dish Camera (Camera 0) watches the sink. A custom YOLOv8/NCNN model detects dishes in real time.
  2. When a dish is detected, the system assigns it a unique tracking ID and begins a 3-second face-capture window.
  3. Face Camera (Camera 4) runs OpenCV LBPH face recognition simultaneously.
  4. After the dish has been stationary for 15 seconds, the system associates it with the closest recognized face from the capture window.
  5. The event (person name, timestamp, dish snapshot, face snapshot) is saved to a SQLite database.
  6. A Flask web dashboard serves live dual-camera feeds and a paginated event history.

Hardware

Bill of Materials

#ItemDescriptionQty
1Raspberry Pi 4Main compute board running all software1
2Logitech Brio4K webcam used as the face recognition camera1
3Small USB CameraCompact USB camera for dish detection at the sink1

Software Architecture

The application is built around a unified Flask server that runs both camera pipelines concurrently.

ScriptDescription
app.pyFlask server, dual camera loop, dish-to-face association logic
dish_tracker.pyYOLOv8/NCNN inference, IoU-based tracking, stationary detection
face_recognizer.pyOpenCV LBPH face detection and recognition
database.pySQLite event storage and query operations
media_cleanup.pyAuto-deletes snapshots older than 7 days

Face Recognition

The face recognition pipeline uses OpenCV's LBPH (Local Binary Pattern Histograms) algorithm with Haar Cascade detection. Before deployment, face images are captured per person using capture_faces_opencv.py and the model is trained with train_faces_opencv.py, producing face_recognizer.xml. 8–10 photos per person are recommended for reliable accuracy.

During operation, the face camera runs recognition every 3rd frame. Faces are labeled with a green bounding box if recognized or red if unknown.

Web Interface

The Flask dashboard is accessible on the local network at http://dish-bot.local:5000.

URLPage
/Live dual-camera dashboard
/historyDetection history with pagination
/api/recent_eventsLast 10 events (JSON)
/api/daily_stats/YYYY-MM-DDDaily dish count by person (JSON)

Dish Tracking Color Key

ColorMeaning
BlueDish is moving
YellowDish is stationary, waiting
OrangeDish stationary 15s+ — ready for association
GreenDish associated with a person

Future Plans

  • Daily leaderboard sent to GroupMe at 10pm
  • Manual override commands via GroupMe
  • Dish removal tracking (when person comes back to wash)
  • Achievement system and streaks
  • Export detection history to CSV