product-recognition-demo/recognization/code
kiyo9w 3a960b1471 fix: the number on the tag is the regular price, and a price must be corroborated
Two corrections, both found by the deep review.

1. The number printed large beside the sale price is NOT the JAN's last three
   digits. Checked against the manufacturer, キユーピー ゼロ ノンコレステロール 310g
   is JAN 4901577092381 - it ends in 381, not the 357 the tag prints. The number is
   the regular (pre-discount) price, and all three tags on the demo shelf confirm it
   against their printed discount: (357-269)/357 = 24.6 % -> 2.4割引,
   (400-379)/400 = 5.25 % -> 0.5割引, (248-199)/248 = 19.8 % -> 1.9割引. The field
   is renamed `regular_price`, the barcode keeps its own name, and the discount is
   now a second arithmetic check alongside the tax-included price - so a tag can be
   checked against itself twice.

2. A price is only readable when that arithmetic corroborates it. Measured on a live
   walk before this: 90 tracks carried a tag marked readable, with prices of 20, 23,
   36, 50, 72, 2002 and 4508. The gate has three strengths - an exact tax pair, an
   agreeing printed discount, or both plus agreeing digits - and `TagRecord.state`
   now consults it, so the wire cannot call an uncorroborated read readable.

Also fixed while measuring: voting picks each field independently, so a record could
publish a price from one frame beside a tax-included price from another (measured:
price 149 with unit 214.92, which never appeared together - 214.92/1.08 = 199). The
arithmetic is now re-run on the values actually being published, stale flags are
dropped, and an implausible regular price (3050 beside 349) is suppressed rather
than published with a discount derived from it.

Measured through the real still path: readable tags 9 -> 5, every published price
now satisfies its own tax-included price, and the live walk publishes none instead
of publishing garbage. 162 tests pass.

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-25 01:29:46 +09:00
..
web feat: price-tag UI, still-image tag passes, and honest tag evidence 2026-09-24 14:11:23 +09:00
__init__.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
app.py feat: let the shelf's own price tag name the product 2026-09-24 23:28:36 +09:00
bench_engine.py feat: recognition engine and session tracker for multi-client serving 2026-09-24 11:52:59 +09:00
bench_identity.py feat: a multi-view embedding gallery, because one template per SKU cannot work 2026-09-24 23:43:27 +09:00
benchmark.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
demo.py perf: bound OCR so a walking scan stays real-time, and add walk pacing 2026-09-24 18:14:32 +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: price-tag UI, still-image tag passes, and honest tag evidence 2026-09-24 14:11:23 +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
gallery.py feat: a multi-view embedding gallery, because one template per SKU cannot work 2026-09-24 23:43:27 +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: a synthetic store walk, and the live tuning it forced out 2026-09-24 18:09:23 +09:00
observe.py feat: identity decision contract and session-local observation model 2026-09-24 11:43:41 +09:00
ocr.py feat: OCR engine, price-tag geometry, and the cached tag pass 2026-09-24 13:52:15 +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
reconcile.py feat: let the shelf's own price tag name the product 2026-09-24 23:28:36 +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
tag_cards.py fix: the number on the tag is the regular price, and a price must be corroborated 2026-09-25 01:29:46 +09:00
tags.py fix: the number on the tag is the regular price, and a price must be corroborated 2026-09-25 01:29:46 +09:00
test.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
test_api.py test: defend the live session and the server API 2026-09-24 12:44:54 +09:00
test_demo.py feat: a synthetic store walk, and the live tuning it forced out 2026-09-24 18:09:23 +09:00
test_empty.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
test_engine.py test: defend engine and tracking contracts 2026-09-24 12:43:32 +09:00
test_gallery.py feat: a multi-view embedding gallery, because one template per SKU cannot work 2026-09-24 23:43:27 +09:00
test_image.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
test_live.py feat: run the tag pass in parallel with recognition, in live and still modes 2026-09-24 13:58:18 +09:00
test_observe.py feat: identity decision contract and session-local observation model 2026-09-24 11:43:41 +09:00
test_ocr_tags.py fix: the number on the tag is the regular price, and a price must be corroborated 2026-09-25 01:29:46 +09:00
test_real_model.py docs: API contract, README for the server and live mode, real-model test 2026-09-24 12:46:54 +09:00
test_reconcile.py fix: count products, not facings, and demand an anchor before accusing 2026-09-24 22:44:50 +09:00
test_suite.py Initial commit for push folder 2026-09-18 09:13:53 +09:00
test_tag_cards.py fix: the number on the tag is the regular price, and a price must be corroborated 2026-09-25 01:29:46 +09:00
test_tag_identity.py feat: let the shelf's own price tag name the product 2026-09-24 23:28:36 +09:00
test_tracking.py test: defend engine and tracking contracts 2026-09-24 12:43:32 +09:00
tracking.py fix: use the tracker imports that exist in ultralytics 8.4.153 2026-09-24 13:36:50 +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