Author: Sheri
Version: 2.0.0
Platform: macOS (Mac mini M2) · Electron + Python
A production-grade computer vision platform for real-time pizza quality control at the store edge. Phase 2 transforms the Phase 1 proof of concept into a deployable system that validates topping accuracy, cheese portioning, and sauce distribution against live order data.
Pizza Check CV monitors the pizza make line through a Sipeed MaixSense A075V RGB-D camera and runs YOLOv11 inference to:
- detect 26 topping classes (including separate diced and sliced tomato detection)
- estimate cheese quantity and coverage within ±10–15%
- validate sauce presence, amount, and distribution
- compare the assembled pizza against the active POS order in real time
- emit pass / warning / fail outcomes for each monitored build
- surface results through an Electron desktop GUI designed for store operators
When POS integration is unavailable, the system falls back gracefully to recipe-only validation mode without crashing.
pizza-check-cv/
├── src/
│ └── pizza_check_cv/
│ └── backend/
│ └── app.py # FastAPI edge backend
├── electron/
│ ├── main.js # Electron shell & backend bridge
│ ├── preload.js # Safe renderer bridge
│ └── renderer/ # Production monitoring UI
├── scripts/
│ └── run_backend.py # Backend launcher
├── data/
│ ├── config.json # Local configuration & recipe seed
│ └── orders.json # Local order queue seed
├── tests/
│ └── test_backend_api.py # Backend smoke coverage
├── package.json # Electron / Node dependencies
├── pyproject.toml # Python package & dependencies
└── yolo11n.pt # Default YOLOv11 nano weights
- Python 3.13+
- Node.js 20+
- (Optional) Sipeed MaixSense A075V RGB-D camera at
192.168.233.1
pip install -e ".[dev]"python scripts/run_backend.pyThe backend starts at http://127.0.0.1:8765 and exposes:
| Method | Endpoint | Description |
|---|---|---|
| GET | /health |
Service health check |
| GET | /api/state |
Current pipeline state |
| GET | /api/config |
Active configuration |
| PUT | /api/config |
Update configuration |
| GET | /api/orders |
Order queue |
| POST | /api/orders |
Inject an order |
| POST | /api/integration/mode |
Set integration mode |
| GET | /api/recent-detections |
Latest CV detections |
| GET | /api/logs |
Structured log stream |
| POST | /api/simulate |
Simulate a detection event |
| POST | /api/capture |
Trigger a manual capture |
| WS | /ws |
Real-time event stream |
npm install
npm startThe launcher automatically sets PYTHONPATH=src so the desktop app boots against the in-repo Python service without a separate package install.
python -m unittest discover -s tests -vThe production camera is the Sipeed MaixSense A075V RGB-D sensor, accessed over HTTP at the vendor default address 192.168.233.1:80.
The backend sends frame configuration to /set_cfg and fetches RGB-D frames from /getdeep. Each frame payload contains a 16-byte header, a 12-byte config block, then depth, IR, status, and optional RGB data. RGB frames arrive as JPEG and are decoded to raw bytes before entering the CV pipeline.
A synthetic fallback is included for development and testing without hardware.
YOLOv11 handles all visual inference tasks:
| Model slot | Default | Purpose |
|---|---|---|
pizzaWeights |
yolo11n.pt |
Pizza presence & format detection |
toppingWeights |
(supply your 26-class model) | Topping identity & counting |
qualityWeights |
(supply your quality model) | Sauce / cheese heuristics |
Store custom weights under models/yolo11/ and point to them via data/config.json or an environment variable. When optional weights are absent the backend starts in degraded mode — the API remains functional and reports pipeline health accurately.
| Goal | Target |
|---|---|
| Topping classes | 26 (YOLO-based) |
| Cheese quantity accuracy | ±10–15% |
| End-to-end validation latency | ≤ 2 seconds |
| Scheduled uptime (pilot) | ≥ 99.5% |
| Sauce / topping precision & recall | ≥ 90% |
| Cheese precision & recall | ≥ 88% |
Full requirements and acceptance criteria are documented in PHASE_2_PIZZA_CHECK_CV_SPEC.md.
| Layer | Technology |
|---|---|
| CV inference | YOLOv11 (Ultralytics) |
| Camera | Sipeed MaixSense A075V RGB-D |
| Backend | Python 3.13 · FastAPI · Uvicorn |
| Desktop shell | Electron 32 |
| Real-time comms | WebSocket (ws) |
| Image processing | OpenCV (headless) |
| HTTP client | Requests |
| Test framework | pytest / unittest |
Private — all rights reserved.
Pizza Check CV Phase 2 · Authored by Sheri