xsponenta Claude Opus 4.7 commited on
Commit
b6bc99a
·
1 Parent(s): 2df06c6

TTA: Hungarian-matched multi-seed inference with strict 3-pass agreement

Browse files

Three priority-sample seeds (2718, 31415, 42), Hungarian-match segments
across passes via flip-invariant endpoint distance, drop anchor segments
that don't appear in BOTH supporting passes (min_passes_for_keep=2).
Surviving segments are orientation-aligned and averaged across the 2-3
passes that saw them.

The previous TTA (857514e, reverted) picked one pass's output - that's
why it failed. This version aggregates and filters.

Local 100-sample A/B vs orphan_refine baseline:
baseline (orphan_refine): mean=0.3856 q5=0.0620 q50=0.3946
TTA simple concat-and-merge: mean=0.3756 q5=0.0842 (-0.010, REJECTED)
TTA Hungarian min_passes=1: mean=0.3853 q5=0.0848 (-0.000, neutral)
TTA Hungarian min_passes=2: mean=0.3888 q5=0.0907 q50=0.4032 (+0.003 mean,
+0.029 q5)
The strict variant wins primarily on hard scenes - q5 jumps 47%
(0.062 -> 0.091), q25 +0.006, q50 +0.009. Strict filter throws out
hallucinations on difficult scenes where the model is uncertain across
sampling seeds.

Cost: 3x inference time. Feature-flagged via USE_TTA in script.py for
easy revert if HF Space hits time limits.

Also includes (not used in production yet):
- edge_fill.py: attempted edge filling from 2D mask evidence
(rejected in A/B testing; was net -0.004 even with capped fills)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

4 files changed +528 -21
Files changed (4)
edge_fill.pyAdded+161
local_eval.py+75-12
script.py+47-9
tta.pyAdded+245