Spaces:
Runtime error
Runtime error
app.py
CHANGED
|
@@ -2,14 +2,14 @@ import gradio as gr
|
|
| 2 |
from PIL import Image
|
| 3 |
|
| 4 |
demo_inf_ofa = gr.Interface.load(name="spaces/ICML2022/OFA") #"spaces/freddyaboulton/blocks_inputs")
|
| 5 |
-
demo_inf_lama = gr.Interface.load(name="spaces/CVPR/lama-example") #gr.Blocks.load
|
| 6 |
#img = gr.Interface.load("spaces/multimodalart/latentdiffusion")(ent[0],'50','256','256','1',10)[0]
|
| 7 |
|
| 8 |
#assert demo_inf("Foo", "bar") == "Foo bar"
|
| 9 |
|
| 10 |
def get_lama(img1, img2):
|
| 11 |
-
|
| 12 |
-
return
|
| 13 |
|
| 14 |
#def txt_fun(txt1, txt2):
|
| 15 |
# return demo_inf(txt1, txt2)
|
|
@@ -46,7 +46,7 @@ with demo:
|
|
| 46 |
with gr.Row():
|
| 47 |
in_image = gr.Image(type='pil') #(visible=False)
|
| 48 |
in_image_mask = gr.Image(type='pil', source="canvas", visible=False)
|
| 49 |
-
out_image = gr.Image()
|
| 50 |
|
| 51 |
#in_text1 = gr.Textbox()
|
| 52 |
#in_text2 = gr.Textbox()
|
|
|
|
| 2 |
from PIL import Image
|
| 3 |
|
| 4 |
demo_inf_ofa = gr.Interface.load(name="spaces/ICML2022/OFA") #"spaces/freddyaboulton/blocks_inputs")
|
| 5 |
+
#demo_inf_lama = gr.Interface.load(name="spaces/CVPR/lama-example") #gr.Blocks.load
|
| 6 |
#img = gr.Interface.load("spaces/multimodalart/latentdiffusion")(ent[0],'50','256','256','1',10)[0]
|
| 7 |
|
| 8 |
#assert demo_inf("Foo", "bar") == "Foo bar"
|
| 9 |
|
| 10 |
def get_lama(img1, img2):
|
| 11 |
+
img, mask = gr.Interface.load(name="spaces/CVPR/lama-example")(img1, img2, "automatic (U2net)")
|
| 12 |
+
return img
|
| 13 |
|
| 14 |
#def txt_fun(txt1, txt2):
|
| 15 |
# return demo_inf(txt1, txt2)
|
|
|
|
| 46 |
with gr.Row():
|
| 47 |
in_image = gr.Image(type='pil') #(visible=False)
|
| 48 |
in_image_mask = gr.Image(type='pil', source="canvas", visible=False)
|
| 49 |
+
out_image = gr.Image(type='file')
|
| 50 |
|
| 51 |
#in_text1 = gr.Textbox()
|
| 52 |
#in_text2 = gr.Textbox()
|