Spaces:
Runtime error
Runtime error
app.py
CHANGED
@@ -1,11 +1,17 @@
|
|
1 |
import gradio as gr
|
2 |
from PIL import Image
|
3 |
|
4 |
-
|
|
|
|
|
|
|
5 |
#assert demo_inf("Foo", "bar") == "Foo bar"
|
6 |
|
7 |
-
def
|
8 |
-
|
|
|
|
|
|
|
9 |
|
10 |
#original = Image.open("./c4.jpg")
|
11 |
#output_img_path = demo_inf("./c4.jpg", fn_index=1)
|
@@ -37,18 +43,19 @@ with demo:
|
|
37 |
"""Testing Inference for Gradio. Work in Progress."""
|
38 |
)
|
39 |
with gr.Row():
|
40 |
-
in_image = gr.Image(visible=False)
|
|
|
41 |
out_image = gr.Image()
|
42 |
|
43 |
-
in_text1 = gr.Textbox()
|
44 |
-
in_text2 = gr.Textbox()
|
45 |
-
out_text = gr.Textbox()
|
46 |
|
47 |
b1 = gr.Button("Image Button")
|
48 |
-
b2 = gr.Button("Text Button")
|
49 |
|
50 |
-
b1.click(
|
51 |
-
b2.click(txt_fun, inputs=[in_text1, in_text2], outputs=out_text)
|
52 |
#examples=examples
|
53 |
|
54 |
-
demo.launch(enable_queue=True, debug=True)
|
|
|
1 |
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 |
+
out = demo_inf_lama()(img1, img2, "automatic (U2net)")
|
12 |
+
|
13 |
+
#def txt_fun(txt1, txt2):
|
14 |
+
# return demo_inf(txt1, txt2)
|
15 |
|
16 |
#original = Image.open("./c4.jpg")
|
17 |
#output_img_path = demo_inf("./c4.jpg", fn_index=1)
|
|
|
43 |
"""Testing Inference for Gradio. Work in Progress."""
|
44 |
)
|
45 |
with gr.Row():
|
46 |
+
in_image = gr.Image() #(visible=False)
|
47 |
+
in_image_mask = gr.Image(visible=False)
|
48 |
out_image = gr.Image()
|
49 |
|
50 |
+
#in_text1 = gr.Textbox()
|
51 |
+
#in_text2 = gr.Textbox()
|
52 |
+
#out_text = gr.Textbox()
|
53 |
|
54 |
b1 = gr.Button("Image Button")
|
55 |
+
#b2 = gr.Button("Text Button")
|
56 |
|
57 |
+
b1.click(get_lama,inputs=[in_image, in_image_mask], outputs=out_image)
|
58 |
+
#b2.click(txt_fun, inputs=[in_text1, in_text2], outputs=out_text)
|
59 |
#examples=examples
|
60 |
|
61 |
+
demo.launch(enable_queue=True, debug=True)
|