agent: dedupe near-duplicate crops before the SigLIP embed #174
Reference in New Issue
Block a user
Delete Branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to the pipeline rewrite (#173). Cuts redundant regions/GPU by deduping near-identical crops before the embed.
Figure boxes are already NMS-merged (iou 0.6) and each YOLO self-NMSes, but the combined per-frame crop pile (figure→concept ∪ anatomy component→concept ∪ panel) was embedded with no cross-proposer dedup — so genuine near-duplicates slipped through (a figure box ≈ an anatomy component on a solo bust; overlapping booru head classes), embedding the same region twice and burning a slot against
max_regions.detectors.dedupe_crops()adds a greedy, high-IoU (default 0.85), kind-aware pass over the pending(crop, template)list right beforeembed_batch: drop boxes overlapping ≥ iou within the same kind, keep the highest score. The high threshold collapses only true near-identical boxes while preserving intentional nested crops across scopes (a whole figure vs a small head component sit well below it) and distinct kinds (concept vs panel). Env-tunableDEDUPE_IOU(≥1.0 disables); runs on CPU before the GPU work. Temporal (cross-frame) dedup deferred. Build marker2026-07-01.2.CI green on dev (run 1812). Validated on the desktop after pull.
🤖 Generated with Claude Code