Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -403,6 +403,9 @@ def apply_mask(d, b):
|
|
403 |
edge = []
|
404 |
mask = cv2.cvtColor(d["layers"][0], cv2.COLOR_RGBA2GRAY)
|
405 |
dilation = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (2 * b + 1, 2 * b + 1), (b, b))
|
|
|
|
|
|
|
406 |
dmask = cv2.dilate(mask, dilation)
|
407 |
|
408 |
d["background"][mask==255] = (255,255,255,255)
|
|
|
403 |
edge = []
|
404 |
mask = cv2.cvtColor(d["layers"][0], cv2.COLOR_RGBA2GRAY)
|
405 |
dilation = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (2 * b + 1, 2 * b + 1), (b, b))
|
406 |
+
mask = cv2.dilate(mask, dilation)
|
407 |
+
b = b*2+1
|
408 |
+
dilation = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (2 * b + 1, 2 * b + 1), (b, b))
|
409 |
dmask = cv2.dilate(mask, dilation)
|
410 |
|
411 |
d["background"][mask==255] = (255,255,255,255)
|