juxuan27 commited on
Commit
401ed77
1 Parent(s): a56355e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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
- mask = cv2.GaussianBlur(mask*255, (21, 21), 0)/255
131
- mask = mask[:,:,np.newaxis]
 
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