Run the cross-check veto in complex-background mode with a hue-free gate

The veto's suspect zone was defined by background-hue projection, so
--no-chroma silently skipped it. Without a key colour there is no hue
test to lean on, so in complex mode the gate instead requires the second
opinion itself to be confidently near-empty (second_lo -> second_hi ramp,
default 0.15 -> 0.40): regions the HR-matting model decisively rejects
can be cleared, while thin strands it merely blurs to mid-alpha are
untouched -- protecting exactly the crisp-strand advantage the pipeline
has over a raw BiRefNet mask. Flat mode's gate is unchanged.

Validation (BG_IMAGE01-04, cuda fp32): flat default path bit-identical;
complex-mode veto touches 0.007-0.025% of pixels, visibly clearing
blurred residue near strands and milky specks in hair gaps with no
strand erosion. Costs the HR-matting forward in --no-chroma runs
(0.61 -> 1.6 s/image warm GPU); disable with --no-cross-check.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-14 13:09:57 +08:00
parent e61fbe84f0
commit 2b3b62ed3f
5 changed files with 48 additions and 25 deletions
+10 -3
View File
@@ -5,9 +5,10 @@ screen_color: null
chroma:
# false = non-flat background mode (--no-chroma): no colour key; segmentation
# alone drives the trimap (mode forced to "seg") and every colour-keyed stage
# is bypassed (auto-detect, hue split, chroma suppression, despill, the
# cross-check veto). Needs segmentation.enabled and matting_method vitmatte.
# alone drives the trimap (mode forced to "seg") and the colour-keyed stages
# are bypassed (auto-detect, hue split, chroma suppression, despill). The
# cross-check veto still runs if enabled, using its hue-free gate (see
# cross_check.second_lo/hi). Needs segmentation.enabled + matting vitmatte.
enabled: true
model:
@@ -98,6 +99,12 @@ cross_check:
feather_sigma: 2.0 # zone-boundary feather, px
gate_lo: 0.70 # primary alpha below this -> fully exempt
gate_hi: 0.95 # primary alpha above this -> fully vetoable
# Complex-background (no-chroma) mode only: no hue-defined suspect zone, so
# the veto requires the second opinion itself to be confidently near-empty --
# full strength at/below second_lo, fading to none at/above second_hi. Thin
# strands the 2048-input second model merely blurs stay untouched.
second_lo: 0.15
second_hi: 0.40
foreground:
enabled: true