Spaces:
Running
Running
Update SegCloth.py
Browse files- SegCloth.py +1 -1
SegCloth.py
CHANGED
|
@@ -38,7 +38,7 @@ def segment_clothing(img, clothes):
|
|
| 38 |
# Expand selected clothing masks using morphological dilation
|
| 39 |
for mask in expand_mask_list:
|
| 40 |
height, width = mask.shape
|
| 41 |
-
kernel_size = max(1, int(0.
|
| 42 |
kernel = np.ones((kernel_size, kernel_size), np.uint8)
|
| 43 |
|
| 44 |
# Dilate mask and merge into final mask
|
|
|
|
| 38 |
# Expand selected clothing masks using morphological dilation
|
| 39 |
for mask in expand_mask_list:
|
| 40 |
height, width = mask.shape
|
| 41 |
+
kernel_size = max(1, int(0.02 * min(height, width))) # 5% expansion
|
| 42 |
kernel = np.ones((kernel_size, kernel_size), np.uint8)
|
| 43 |
|
| 44 |
# Dilate mask and merge into final mask
|