Product recognition demo for supermarket shelf images
`score_crop` returns only scores the gallery already accepted: the raw 0.55 line, or the fine-tuned head's own 0.40. The live path then ranked that aggregate with `decide_identity(scale="cosine")`, whose defaults rewrite to COSINE_ACCEPT 0.60 / COSINE_AMBIGUOUS 0.50 - a second, higher line. Every head match between 0.40 and 0.60 was therefore refused or downgraded to ambiguous, which is the live regression: the head's own training views score 0.57-0.77. `engine.inspect` and `_classify_with_gallery` already avoid this by ranking through `decision_for_match`, which applies only the published margin. The live path now does the same: on the cosine scale it passes explicit zero accept lines, so the margin gate is the only extra gate. Regression tests: a 0.45 head-scale match is labelled (fails on the previous code), and a 0.45/0.44 pair inside the margin stays unnamed. Verified: `python -m unittest discover -s code -p 'test_*.py'` - 257 tests, OK, 2 skipped. |
||
|---|---|---|
| .github/workflows | ||
| recognization | ||
| .gitignore | ||