product-recognition-demo/recognization/code
kiyo9w 6902067322 feat: web client with live and photo modes, served by the server
The client is a pure API consumer: live frames go out over /v1/stream, stills
over /v1/recognize, and it can be pointed at another server with
?server=&token=. It keeps the team's visual identity (green palette, logo, EN/JA
toggle) and adds the live surface: state-coloured boxes with name/price chips,
interpolated track boxes, a results/s + latency HUD, quality hints, and an
in-view list that highlights a SKU's boxes.

Photo mode recognises the whole shelf at once instead of one click per product:
boxes paint immediately, identities fill in, tapping a product inspects it
(crop + feature-match visualization), the algorithm selector re-classifies, and
dispense updates stock.

Fixes found by browser verification with a synthetic camera feed:
- The WebSocket handler referenced its processing loop before definition, so the
  socket died with NameError and live mode never received a result. Helpers are
  now defined inside the handler.
- The client never kept a reference to the video element, so frame capture
  returned early and nothing was ever sent.
- /v1/images/{id}/classify passed detection dicts where the engine expected box
  dicts (KeyError: 'width').
- Placeholder chrome (thumb, dashes, hidden groups) leaked on first paint.

Verified in Chrome with a fake camera: live 8-12 results/s, ~60 products in
view, product card and feature matching populated, photo 105/170 recognised on
image.jpg and 59/111 on add/image6.jpg, 0 console errors.

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-24 12:42:02 +09:00
..
web feat: web client with live and photo modes, served by the server 2026-09-24 12:42:02 +09:00
__init__.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
app.py feat: web client with live and photo modes, served by the server 2026-09-24 12:42:02 +09:00
bench_engine.py feat: recognition engine and session tracker for multi-client serving 2026-09-24 11:52:59 +09:00
benchmark.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
detector.py refactor: make the matcher and detector safe for concurrent clients 2026-09-24 11:43:24 +09:00
download_stock.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
empty_shelf_detector.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
engine.py feat: web client with live and photo modes, served by the server 2026-09-24 12:42:02 +09:00
fast_test.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
feature_matcher.py feat: recognition server API, reference stream client, and live label memory 2026-09-24 12:31:17 +09:00
gui_app.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
identity.py feat: identity decision contract and session-local observation model 2026-09-24 11:43:41 +09:00
inventory.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
live.py feat: recognition server API, reference stream client, and live label memory 2026-09-24 12:31:17 +09:00
observe.py feat: identity decision contract and session-local observation model 2026-09-24 11:43:41 +09:00
orb.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
pipeline.py feat: identity decision contract and session-local observation model 2026-09-24 11:43:41 +09:00
stream_client.py feat: recognition server API, reference stream client, and live label memory 2026-09-24 12:31:17 +09:00
suft.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
test.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
test_empty.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
test_image.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
test_observe.py feat: identity decision contract and session-local observation model 2026-09-24 11:43:41 +09:00
test_suite.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
tracking.py feat: recognition engine and session tracker for multi-client serving 2026-09-24 11:52:59 +09:00
train.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
yolo_adapter.py feat: identity decision contract and session-local observation model 2026-09-24 11:43:41 +09:00