example dir
Browse files
app.py
CHANGED
@@ -65,26 +65,24 @@ with gr.Blocks() as demo:
|
|
65 |
with gr.Tab("Upload image"):
|
66 |
with gr.Row():
|
67 |
with gr.Column():
|
68 |
-
inputs_file=[gr.Image(source="webcam"),
|
69 |
-
"text",
|
70 |
-
gr.Slider(0, 1, value=0.1)]
|
71 |
submit_btn = gr.Button("Submit")
|
|
|
72 |
im_output = gr.Image()
|
73 |
|
74 |
|
75 |
with gr.Tab("Capture image with webcam"):
|
76 |
with gr.Row():
|
77 |
with gr.Column():
|
78 |
-
inputs_web=[gr.Image(source="webcam"),
|
79 |
-
"text",
|
80 |
-
gr.Slider(0, 1, value=0.1)]
|
81 |
submit_btn_web = gr.Button("Submit")
|
82 |
|
83 |
web_output = gr.Image()
|
84 |
|
85 |
-
|
86 |
submit_btn.click(fn=query_image, inputs= inputs_file, outputs = im_output)
|
87 |
submit_btn_web.click(fn=query_image, inputs= inputs_web, outputs = web_output)
|
|
|
88 |
gr.Examples(
|
89 |
examples= os.path.join("examples", "IMGP0178.jpg"),
|
90 |
fn=query_image,
|
@@ -92,4 +90,5 @@ with gr.Blocks() as demo:
|
|
92 |
outputs=im_output,
|
93 |
cache_examples=False
|
94 |
)
|
|
|
95 |
demo.launch()
|
|
|
65 |
with gr.Tab("Upload image"):
|
66 |
with gr.Row():
|
67 |
with gr.Column():
|
68 |
+
inputs_file=[gr.Image(source="webcam"), gr.Textbox(), gr.Slider(0, 1, value=0.1)]
|
|
|
|
|
69 |
submit_btn = gr.Button("Submit")
|
70 |
+
|
71 |
im_output = gr.Image()
|
72 |
|
73 |
|
74 |
with gr.Tab("Capture image with webcam"):
|
75 |
with gr.Row():
|
76 |
with gr.Column():
|
77 |
+
inputs_web=[gr.Image(source="webcam"), gr.Textbox(), gr.Slider(0, 1, value=0.1)]
|
|
|
|
|
78 |
submit_btn_web = gr.Button("Submit")
|
79 |
|
80 |
web_output = gr.Image()
|
81 |
|
82 |
+
|
83 |
submit_btn.click(fn=query_image, inputs= inputs_file, outputs = im_output)
|
84 |
submit_btn_web.click(fn=query_image, inputs= inputs_web, outputs = web_output)
|
85 |
+
|
86 |
gr.Examples(
|
87 |
examples= os.path.join("examples", "IMGP0178.jpg"),
|
88 |
fn=query_image,
|
|
|
90 |
outputs=im_output,
|
91 |
cache_examples=False
|
92 |
)
|
93 |
+
|
94 |
demo.launch()
|