fffiloni commited on
Commit
6596e7b
1 Parent(s): 36bae83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -12,14 +12,13 @@ import imageio
12
  os.mkdir("data")
13
  os.rename("best.ckpt", "models/best.ckpt")
14
  os.mkdir("dataout")
15
- model = hub.Module(name='U2Net')
16
 
17
 
18
- def infer(img, mask):
19
 
20
 
21
  img = Image.open(img)
22
- mask = Image.open(mask)
23
  inverted_mask = ImageOps.invert(mask)
24
 
25
 
@@ -29,8 +28,7 @@ def infer(img, mask):
29
  return "./dataout/data_mask.png", "./data/data_mask.png"
30
 
31
 
32
- inputs = [gr.Image(label="Input", source="upload", type="filepath"),
33
- gr.Image(label="Mask", source="upload", type="filepath")]
34
  outputs = [gr.outputs.Image(type="file", label="output"),
35
  gr.outputs.Image(type="file", label="Mask")]
36
  title = "LaMa Image Inpainting"
 
12
  os.mkdir("data")
13
  os.rename("best.ckpt", "models/best.ckpt")
14
  os.mkdir("dataout")
 
15
 
16
 
17
+ def infer(img):
18
 
19
 
20
  img = Image.open(img)
21
+ mask = Image.open("./masks/modelscope-mask.png")
22
  inverted_mask = ImageOps.invert(mask)
23
 
24
 
 
28
  return "./dataout/data_mask.png", "./data/data_mask.png"
29
 
30
 
31
+ inputs = [gr.Image(label="Input", source="upload", type="filepath")]
 
32
  outputs = [gr.outputs.Image(type="file", label="output"),
33
  gr.outputs.Image(type="file", label="Mask")]
34
  title = "LaMa Image Inpainting"