Spaces:
Runtime error
Runtime error
Ahsen Khaliq
commited on
Commit
·
ddbdbba
1
Parent(s):
d160659
Update app.py
Browse files
app.py
CHANGED
@@ -30,13 +30,13 @@ def infer(img,mask,option):
|
|
30 |
os.system('python predict.py model.path=/home/user/app/big-lama/ indir=/home/user/app/data/ outdir=/home/user/app/dataout/ device=cpu')
|
31 |
return "./dataout/data_mask.png",im
|
32 |
|
33 |
-
inputs = [gr.inputs.Image(type='pil', label="Original Image"),gr.inputs.Image(type='pil',source="canvas", label="Mask",
|
34 |
outputs = [gr.outputs.Image(type="file",label="output"),gr.outputs.Image(type="pil",label="Mask")]
|
35 |
title = "LaMa Image Inpainting"
|
36 |
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"
|
37 |
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>"
|
38 |
examples = [
|
39 |
-
['person512.png',
|
40 |
['person512.png',"maskexam.png","manual"]
|
41 |
]
|
42 |
gr.Interface(infer, inputs, outputs, title=title, description=description, article=article, examples=examples).launch(enable_queue=True)
|
|
|
30 |
os.system('python predict.py model.path=/home/user/app/big-lama/ indir=/home/user/app/data/ outdir=/home/user/app/dataout/ device=cpu')
|
31 |
return "./dataout/data_mask.png",im
|
32 |
|
33 |
+
inputs = [gr.inputs.Image(type='pil', label="Original Image"),gr.inputs.Image(type='pil',source="canvas", label="Mask",invert_colors=True),gr.inputs.Radio(choices=["automatic (U2net)","manual"], type="value", default="manual", label="Masking option")]
|
34 |
outputs = [gr.outputs.Image(type="file",label="output"),gr.outputs.Image(type="pil",label="Mask")]
|
35 |
title = "LaMa Image Inpainting"
|
36 |
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"
|
37 |
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>"
|
38 |
examples = [
|
39 |
+
['person512.png',"maskexam.png","automatic (U2net)"],
|
40 |
['person512.png',"maskexam.png","manual"]
|
41 |
]
|
42 |
gr.Interface(infer, inputs, outputs, title=title, description=description, article=article, examples=examples).launch(enable_queue=True)
|