Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -127,8 +127,9 @@ def process(input_image,
|
|
127 |
raise gr.Error('Using blurred blending with control strength less than 1.0 is not allowed')
|
128 |
blended_image=[]
|
129 |
# blur, you can adjust the parameters for better performance
|
130 |
-
|
131 |
-
|
|
|
132 |
for image_i in image:
|
133 |
image_np=np.array(image_i)
|
134 |
image_pasted=original_image * (1-mask) + image_np*mask
|
|
|
127 |
raise gr.Error('Using blurred blending with control strength less than 1.0 is not allowed')
|
128 |
blended_image=[]
|
129 |
# blur, you can adjust the parameters for better performance
|
130 |
+
mask_blurred = cv2.GaussianBlur(mask*255, (21, 21), 0)/255
|
131 |
+
mask_blurred = mask_blurred[:,:,np.newaxis]
|
132 |
+
mask = 1-(1-mask) * (1-mask_blurred)
|
133 |
for image_i in image:
|
134 |
image_np=np.array(image_i)
|
135 |
image_pasted=original_image * (1-mask) + image_np*mask
|