Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -32,13 +32,9 @@ def infer(img,option):
|
|
32 |
os.system('python predict.py model.path=/home/user/app/ indir=/home/user/app/data/ outdir=/home/user/app/dataout/ device=cpu')
|
33 |
return "./dataout/data_mask.png","./data/data_mask.png"
|
34 |
|
35 |
-
inputs = [gr.Image(tool="sketch", label="Input",type="numpy"),gr.inputs.Radio(choices=["automatic (U2net)","manual"], type="value", default="manual", label="Masking option")]
|
36 |
outputs = [gr.outputs.Image(type="file",label="output"),gr.outputs.Image(type="file",label="Mask")]
|
37 |
title = "LaMa Image Inpainting"
|
38 |
description = "Gradio demo for LaMa: Resolution-robust Large Mask Inpainting with Fourier Convolutions. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below. Masks are generated by U^2net"
|
39 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2109.07161' target='_blank'>Resolution-robust Large Mask Inpainting with Fourier Convolutions</a> | <a href='https://github.com/saic-mdal/lama' target='_blank'>Github Repo</a></p>"
|
40 |
-
|
41 |
-
['person512.png',"automatic (U2net)"],
|
42 |
-
['person512.png',"manual"]
|
43 |
-
]
|
44 |
-
gr.Interface(infer, inputs, outputs, title=title, description=description, article=article, examples=examples,cache_examples=False).launch()
|
|
|
32 |
os.system('python predict.py model.path=/home/user/app/ indir=/home/user/app/data/ outdir=/home/user/app/dataout/ device=cpu')
|
33 |
return "./dataout/data_mask.png","./data/data_mask.png"
|
34 |
|
35 |
+
inputs = [gr.Image(tool="sketch", label="Input",type="numpy", value="person512.png"),gr.inputs.Radio(choices=["automatic (U2net)","manual"], type="value", default="manual", label="Masking option")]
|
36 |
outputs = [gr.outputs.Image(type="file",label="output"),gr.outputs.Image(type="file",label="Mask")]
|
37 |
title = "LaMa Image Inpainting"
|
38 |
description = "Gradio demo for LaMa: Resolution-robust Large Mask Inpainting with Fourier Convolutions. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below. Masks are generated by U^2net"
|
39 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2109.07161' target='_blank'>Resolution-robust Large Mask Inpainting with Fourier Convolutions</a> | <a href='https://github.com/saic-mdal/lama' target='_blank'>Github Repo</a></p>"
|
40 |
+
gr.Interface(infer, inputs, outputs, title=title, description=description, article=article, cache_examples=False).launch()
|
|
|
|
|
|
|
|