Align defaults with server-edition: reuse-as-seg and despill both OFF

Adopt server-edition's settings.py and default.yaml verbatim (zero diff on
these files between branches now):

- reuse_as_seg: false. The reuse equivalence holds for solid figures but
  breaks on thin pale strokes over a low-contrast background: HR-matting
  (trained on P3M-10k portraits + AM-2k animals) reads them as
  semi-transparent wisps, and as the trimap topology source it destroys
  white calligraphy (TestImage4: stroke alpha 0.92 -> 0.51, 48% of stroke
  pixels below 0.5) that the DIS5K-trained segmenter keeps solid (seg 0.97
  vs 0.40). As the gated cross-check veto the same signal stays harmless
  (hue gate excludes neutral strokes; confidence gate exempts soft edges).
  Opt in with --cross-check-as-seg for character batches.

- despill.enabled: false (mirrors server ba5d667): no positional/semantic
  guard, desaturates and hue-shifts subjects sharing the background's hue.

README updated accordingly; the performance table notes its numbers were
measured with reuse on.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-11 12:37:02 +08:00
parent 18c6918e45
commit f22af16517
4 changed files with 41 additions and 25 deletions
+7 -3
View File
@@ -80,8 +80,9 @@ cross_check:
# trimap 99.8% identical, no structural change (fingers/wisps/bowstring OK).
# Only applies to the birefnet backend (same-family swap); anime-seg keeps
# its own forward, with the cross-check running independently on top.
# Disable with --no-cross-check-as-seg. No effect when cross_check is off.
reuse_as_seg: true
# Default OFF (server-edition): the dedicated segmenter keeps its own forward
# and the veto stays independent; enable with --cross-check-as-seg.
reuse_as_seg: false
# Cross-check forward precision, same semantics as segmentation.precision
# (bf16 via autocast: 2048 pass ~35s -> ~26s on a native-bf16 CPU).
precision: fp32
@@ -109,7 +110,10 @@ foreground:
bg_confidence_weight: 0.70
despill:
enabled: true
# Off: despill has no positional/semantic guard, so a subject sharing the
# background's hue (blue suit on a blue backdrop) gets desaturated/hue-shifted
# (~ΔE 35, blue -> purple). Re-enable per-job only when edge spill matters.
enabled: false
edge_low: 0.005
strength: 0.92
edge_expand_radius: 2