vilarin commited on
Commit
d491dbe
·
verified ·
1 Parent(s): 1bd4e58

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -66,8 +66,10 @@ def inpaintGen(
66
  raise gr.Error("Please draw a mask on the image.")
67
 
68
  source_img = Image.open(source_path).convert("RGB")
69
- mask_img = Image.open(mask_path).convert('L')
70
- mask_img = Image.fromarray(255 - np.array(mask_img))
 
 
71
 
72
  #mask_img = create_mask_image(mask_img)
73
 
 
66
  raise gr.Error("Please draw a mask on the image.")
67
 
68
  source_img = Image.open(source_path).convert("RGB")
69
+ mask_img = Image.open(mask_path)
70
+ if mask_img.mode != 'L':
71
+ mask_img = mask_img.convert('L')
72
+ mask_img = ImageOps.invert(mask_img)
73
 
74
  #mask_img = create_mask_image(mask_img)
75