product-recognition-demo/recognization/code
kiyo9w e25fcda67d fix(eval): confirm a leak signature before calling it one, and score external sets in code
Enrolling a packshot from an external set is normal - it is how F-12 was
closed - and it silently turns one of those rows into training data. The
external sets were scored by an ad-hoc script that never checked, so
sku_l06_1.jpg was being reported as a held-out correct accept while being
byte-identical to the enrolled view.

code/eval_external.py now scores those sets with the same leaked() check the
shelf evaluator runs, and refuses a row that has since been enrolled.

That check needed fixing first. Its 64x64 signature fires on two different
photographs of the same product: the l09 rear label from a retailer page sits
19.5 from the enrolled front packshot, under the 20.0 line, while being a
different photograph (resized MAD 26.3). A signature hit is now confirmed by
correlation - a genuine re-cut, re-encode or rescale correlates at 0.99+, that
pair at 0.28 - so the two signals together are decisive where either alone is
not. Verified against both directions: identical, q55 re-encode and 700px
rescale are caught; the different-photo pair is not.

Also adds the van backend (always-argmax, no gate) so the stream comparison in
DECISION.md is reproducible rather than asserted, with two tests pinning that
it answers where the shipped gate abstains and still refuses an empty score set.

External result on the corrected basis: 19 scored, 12 correct, 7 abstain,
0 false accepts, 1 leak excluded. Suite 307 -> 309.
2026-09-29 03:29:56 +09:00
..
web fix: restore reliable authenticated live recognition 2026-09-28 12:38:15 +09:00
__init__.py
app.py fix(eval): confirm a leak signature before calling it one, and score external sets in code 2026-09-29 03:29:56 +09:00
bench_engine.py
bench_identity.py
build_store_from_shelf.py fix: require explicit safe shelf enrollment paths 2026-09-28 13:41:43 +09:00
collect_shelf_images.py fix(catalog): correct sku_l10 to 400g and enroll its packshot 2026-09-29 02:45:21 +09:00
detector.py
empty_shelf_detector.py
engine.py fix(eval): confirm a leak signature before calling it one, and score external sets in code 2026-09-29 03:29:56 +09:00
eval_external.py fix(eval): confirm a leak signature before calling it one, and score external sets in code 2026-09-29 03:29:56 +09:00
eval_external_images.py fix(catalog): correct sku_l10 to 400g and enroll its packshot 2026-09-29 02:45:21 +09:00
eval_identity.py fix(eval): confirm a leak signature before calling it one, and score external sets in code 2026-09-29 03:29:56 +09:00
eval_live.py docs: name the local lane in the evaluators' own lane vocabulary 2026-09-28 22:34:06 +09:00
feature_matcher.py
finetune_identity.py fix(catalog): correct sku_l10 to 400g and enroll its packshot 2026-09-29 02:45:21 +09:00
gallery.py feat(identity): local-feature matcher plus text lane as the default backend 2026-09-28 22:27:21 +09:00
identity.py fix(eval): confirm a leak signature before calling it one, and score external sets in code 2026-09-29 03:29:56 +09:00
identity_lanes.py fix(identity): veto a local answer the read contradicts on package size 2026-09-29 03:04:21 +09:00
inventory.py
live.py fix(eval): confirm a leak signature before calling it one, and score external sets in code 2026-09-29 03:29:56 +09:00
ocr.py feat: add bounded crop evidence and keyed gallery cache 2026-09-28 15:49:34 +09:00
rebuild_catalog.py Enroll from a repo data dir; read packshots in every orientation 2026-09-29 02:33:47 +09:00
reconcile.py fix: a tag may not accuse on weak evidence, nor name a distant product 2026-09-25 01:30:03 +09:00
record.py fix: record and require the walk identity backend 2026-09-28 14:42:03 +09:00
score_stream.py Fix label frame mapping and reference upscaling; add the stream G1 harness 2026-09-29 00:30:17 +09:00
shelf_map.py feat: a shelf map, so a facing outlives the track id that found it 2026-09-25 01:54:38 +09:00
stream_client.py Fix label frame mapping and reference upscaling; add the stream G1 harness 2026-09-29 00:30:17 +09:00
tag_cards.py fix: restore reliable authenticated live recognition 2026-09-28 12:38:15 +09:00
tags.py fix: bind tag projection to each frame origin 2026-09-28 14:41:49 +09:00
test_api.py feat(identity): local-feature matcher plus text lane as the default backend 2026-09-28 22:27:21 +09:00
test_engine.py fix(identity): veto a local answer the read contradicts on package size 2026-09-29 03:04:21 +09:00
test_eval_labels.py feat: refuse a label file whose rows carry no provenance 2026-09-28 23:31:53 +09:00
test_eval_live.py fix: record and require the walk identity backend 2026-09-28 14:42:03 +09:00
test_gallery.py fix: serialize gallery inference so Metal cannot be entered twice 2026-09-28 17:22:55 +09:00
test_identity.py fix(eval): confirm a leak signature before calling it one, and score external sets in code 2026-09-29 03:29:56 +09:00
test_live.py Improve identity lanes: text evidence floor, motion-compensated labels 2026-09-29 02:08:23 +09:00
test_ocr_tags.py fix: bind tag projection to each frame origin 2026-09-28 14:41:49 +09:00
test_real_model.py
test_rebuild_catalog.py Enroll from a repo data dir; read packshots in every orientation 2026-09-29 02:33:47 +09:00
test_reconcile.py fix: a tag may not accuse on weak evidence, nor name a distant product 2026-09-25 01:30:03 +09:00
test_record.py fix: record and require the walk identity backend 2026-09-28 14:42:03 +09:00
test_shelf_map.py feat: a shelf map, so a facing outlives the track id that found it 2026-09-25 01:54:38 +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 fix: a tag may not accuse on weak evidence, nor name a distant product 2026-09-25 01:30:03 +09:00
test_tracking.py
tracking.py fix: restore reliable authenticated live recognition 2026-09-28 12:38:15 +09:00
train.py
transport.py fix: guard reserved sessions and bounded response state 2026-09-28 13:41:35 +09:00