Spaces:
Running
Running
Update SegCloth.py
Browse files- SegCloth.py +3 -1
SegCloth.py
CHANGED
@@ -39,8 +39,10 @@ def segment_clothing(img, clothes):
|
|
39 |
# Expand selected clothing masks using closing + dilation
|
40 |
for mask in expand_mask_list:
|
41 |
height, width = mask.shape
|
42 |
-
kernel_size = max(
|
43 |
print(kernel_size)
|
|
|
|
|
44 |
kernel = np.ones((kernel_size, kernel_size), np.uint8)
|
45 |
|
46 |
# **Step 1: Fill gaps using Closing (Dilation + Erosion)**
|
|
|
39 |
# Expand selected clothing masks using closing + dilation
|
40 |
for mask in expand_mask_list:
|
41 |
height, width = mask.shape
|
42 |
+
kernel_size = max(20, int(0.02 * min(height, width))) # 5% expansion
|
43 |
print(kernel_size)
|
44 |
+
print(height)
|
45 |
+
print(width)
|
46 |
kernel = np.ones((kernel_size, kernel_size), np.uint8)
|
47 |
|
48 |
# **Step 1: Fill gaps using Closing (Dilation + Erosion)**
|