Update app.py
Browse files
app.py
CHANGED
@@ -50,7 +50,7 @@ def process_image(image, categories_to_hide):
|
|
50 |
|
51 |
# Determine kernel size (2% of the smaller image dimension)
|
52 |
height, width = clothing_mask.shape
|
53 |
-
kernel_size = max(
|
54 |
kernel = np.ones((kernel_size, kernel_size), np.uint8)
|
55 |
|
56 |
# **Step 1: Fill gaps using Morphological Closing (Dilation + Erosion)**
|
|
|
50 |
|
51 |
# Determine kernel size (2% of the smaller image dimension)
|
52 |
height, width = clothing_mask.shape
|
53 |
+
kernel_size = max(20, int(0.02 * min(height, width))) # Ensure at least 1 pixel
|
54 |
kernel = np.ones((kernel_size, kernel_size), np.uint8)
|
55 |
|
56 |
# **Step 1: Fill gaps using Morphological Closing (Dilation + Erosion)**
|