feat(eval): add --no-text so the E-3 claim is reproducible
E-3 asks what the text lane is worth, and the record answered it with numbers that no committed command could produce - the evaluator had no way to run the local lane without the text lane. --no-text is that way, and it keeps the comparison to one variable by building the lane either way, so the OCR cost is paid in both arms. Measured: full resolution 77% end-to-end at 91% precision with text against 61% at 66% without (5 false accepts against 20); live 62% at 93% against 56% at 84% (3 against 7). The lane adds 16 pp and 6 pp of coverage while raising precision, against E-3's +5 pp bar. Also refreshes the re-measured block above it, which still printed the pre-correction 61/48 label counts and a stray 'HUB!' marker.
This commit is contained in:
parent
56cff09292
commit
a1c69f72fe
2 changed files with 25 additions and 14 deletions
|
|
@ -413,10 +413,14 @@ class LocalLaneAdapter(Lane):
|
|||
|
||||
name = "local"
|
||||
|
||||
def __init__(self, stock_dir: str, ocr: Any = None) -> None:
|
||||
def __init__(self, stock_dir: str, ocr: Any = None, use_text: bool = True) -> None:
|
||||
from identity_lanes import LocalLane, TextLane
|
||||
|
||||
self.lane = LocalLane(stock_dir)
|
||||
# E-3 asks what the text lane is worth, which is only answerable by
|
||||
# running the same crops without it. Building the lane anyway keeps the
|
||||
# comparison to one variable: the OCR cost is paid either way.
|
||||
self.use_text = use_text
|
||||
self.text_lane = TextLane.from_catalog(
|
||||
_catalog_rows(stock_dir), stock_dir, ocr if ocr is not None else _ocr_engine()
|
||||
)
|
||||
|
|
@ -428,6 +432,10 @@ class LocalLaneAdapter(Lane):
|
|||
margin: float, scale: str) -> Dict[str, Any]:
|
||||
from identity_lanes import DecisionPolicy
|
||||
|
||||
if not self.use_text:
|
||||
from identity import decide_identity
|
||||
|
||||
return decide_identity(dict(ranked), scale="local", min_score=accept)
|
||||
read = self.text_lane.read(crop)
|
||||
text_rank = sorted(
|
||||
self.text_lane.scores_from_text(read).items(),
|
||||
|
|
@ -641,6 +649,8 @@ def main() -> int:
|
|||
parser.add_argument("--lanes", default="local,matcher,gallery,hybrid-verify")
|
||||
parser.add_argument("--shortlist", type=int, default=5)
|
||||
parser.add_argument("--accept", type=float, default=None, help="override the lane's own floor")
|
||||
parser.add_argument("--no-text", action="store_true",
|
||||
help="run the local lane without the text lane (E-3)")
|
||||
parser.add_argument("--margin", type=float, default=None)
|
||||
parser.add_argument("--live", action="store_true", help="also score at live resolution")
|
||||
parser.add_argument("--json", help="write the report here")
|
||||
|
|
@ -680,7 +690,7 @@ def main() -> int:
|
|||
if "van" in wanted:
|
||||
lanes["van"] = VanLane(args.stock_dir)
|
||||
if "local" in wanted:
|
||||
lanes["local"] = LocalLaneAdapter(args.stock_dir)
|
||||
lanes["local"] = LocalLaneAdapter(args.stock_dir, use_text=not args.no_text)
|
||||
if "gallery" in wanted or "hybrid-verify" in wanted:
|
||||
lanes["gallery"] = GalleryLane(args.stock_dir, catalog_skus)
|
||||
if "hybrid-verify" in wanted:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue