From 5ab3d7eb7c138ad1bb1058a8658ef8acac5379bc Mon Sep 17 00:00:00 2001 From: lingh Date: Tue, 30 Jun 2026 22:01:23 +0800 Subject: [PATCH] Lower seg_loose_threshold to 0.08 Route faint hair (BiRefNet M 0.08-0.15) into the unknown band instead of sure background, giving ViTMatte a chance at it. On its own this does not recover the green-contaminated shoulder wisps: those are ~pure green (dominance +0.88, like the screen) so ViTMatte cuts them regardless of trimap -- that is handled by the upcoming segmentation dropout-fill. The finger gap (M~0.02) stays sure background. Co-Authored-By: Claude Opus 4.8 --- bgfilter/settings.py | 2 +- configs/default.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bgfilter/settings.py b/bgfilter/settings.py index 2298f8b..a9e1250 100644 --- a/bgfilter/settings.py +++ b/bgfilter/settings.py @@ -27,7 +27,7 @@ class TrimapSettings: min_fg_safe_radius: int = 2 # Semantic fusion thresholds (used by fuse_trimap when segmentation is on). seg_core_threshold: float = 0.60 - seg_loose_threshold: float = 0.15 + seg_loose_threshold: float = 0.08 @dataclass(frozen=True) diff --git a/configs/default.yaml b/configs/default.yaml index 95571f4..13dc8f2 100644 --- a/configs/default.yaml +++ b/configs/default.yaml @@ -16,7 +16,7 @@ trimap: unknown_radius_ratio: 0.012 fg_safe_radius_ratio: 0.006 seg_core_threshold: 0.60 - seg_loose_threshold: 0.15 + seg_loose_threshold: 0.08 alpha_post: chroma_suppress: true