Spaces:
Paused
Paused
Threshold Updated to 7,7
Browse files
app.py
CHANGED
|
@@ -124,8 +124,8 @@ def _process_saree_core(base_image: Image.Image, pattern_image: Image.Image):
|
|
| 124 |
mask_alpha = np.array(mask_img)[:, :, 3].astype(np.float32) / 255.0
|
| 125 |
|
| 126 |
# 1. Slightly stronger shrink (balanced)
|
| 127 |
-
kernel = np.ones((
|
| 128 |
-
mask_binary = (mask_alpha > 0.
|
| 129 |
mask_eroded = cv2.erode(mask_binary, kernel, iterations=3) # balanced erosion
|
| 130 |
|
| 131 |
|
|
|
|
| 124 |
mask_alpha = np.array(mask_img)[:, :, 3].astype(np.float32) / 255.0
|
| 125 |
|
| 126 |
# 1. Slightly stronger shrink (balanced)
|
| 127 |
+
kernel = np.ones((7, 7), np.uint8) # slightly larger kernel
|
| 128 |
+
mask_binary = (mask_alpha > 0.07).astype(np.uint8) * 255 # slightly stricter threshold
|
| 129 |
mask_eroded = cv2.erode(mask_binary, kernel, iterations=3) # balanced erosion
|
| 130 |
|
| 131 |
|