Change inlier ratio threshold from 0.6 to 0.5

This commit is contained in:
AhBumm
2025-12-05 15:43:00 +08:00
committed by GitHub
parent a55e235559
commit 57fa63cffc
+2 -2
View File
@@ -58,7 +58,7 @@ def estimate_bg_color_from_border(img_lab: np.ndarray, border_width: int = BORDE
print(f"[estimate_bg_color] inlier_ratio={inlier_ratio:.3f} (thresh={inlier_thresh})")
if inlier_ratio < 0.6: # At least 60% of the border should be background
if inlier_ratio < 0.5: # At least 50% of the border should be background
print("[estimate_bg_color] inlier ratio too low, reject.")
return bg_color.astype(np.float32), False, 10.0
@@ -259,4 +259,4 @@ class MOD_RMBG_NODE:
tensor_out = ndarray2tensor(rgba)
tensor_fg_mask = ndarray2tensor(fg_mask)
tensor_bg_mask = ndarray2tensor(bg_mask_vis)
return (tensor_out, tensor_fg_mask, tensor_bg_mask,)
return (tensor_out, tensor_fg_mask, tensor_bg_mask,)