Spaces:
Runtime error
Runtime error
Update
Browse files
demo.py
CHANGED
@@ -160,7 +160,7 @@ with gr.Blocks() as demo:
|
|
160 |
id_examples = gr.Examples(
|
161 |
examples=[['examples/11.jpg', 'examples/12.jpg'], ['examples/21.jpg', 'examples/22.jpg'], ['examples/3.jpg', None]],
|
162 |
inputs=[id_image_input1, id_image_input2],
|
163 |
-
outputs=
|
164 |
fn=idcard_recognition
|
165 |
)
|
166 |
|
@@ -191,10 +191,10 @@ with gr.Blocks() as demo:
|
|
191 |
credit_image_input = gr.Image(type='filepath')
|
192 |
credit_recognition_button = gr.Button("Credit Card Recognition")
|
193 |
gr.Markdown("## Examples")
|
194 |
-
gr.Examples(
|
195 |
examples=['examples/c1.jpg', 'examples/c2.jpg', 'examples/c3.jpg'],
|
196 |
inputs=credit_image_input,
|
197 |
-
outputs=
|
198 |
fn=credit_recognition
|
199 |
)
|
200 |
|
@@ -204,6 +204,7 @@ with gr.Blocks() as demo:
|
|
204 |
with gr.Column(scale=2):
|
205 |
image_result_output = gr.HTML()
|
206 |
|
|
|
207 |
credit_recognition_button.click(credit_recognition, inputs=credit_image_input, outputs=[credit_result_output, image_result_output])
|
208 |
|
209 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
160 |
id_examples = gr.Examples(
|
161 |
examples=[['examples/11.jpg', 'examples/12.jpg'], ['examples/21.jpg', 'examples/22.jpg'], ['examples/3.jpg', None]],
|
162 |
inputs=[id_image_input1, id_image_input2],
|
163 |
+
outputs=None,
|
164 |
fn=idcard_recognition
|
165 |
)
|
166 |
|
|
|
191 |
credit_image_input = gr.Image(type='filepath')
|
192 |
credit_recognition_button = gr.Button("Credit Card Recognition")
|
193 |
gr.Markdown("## Examples")
|
194 |
+
credit_examples = gr.Examples(
|
195 |
examples=['examples/c1.jpg', 'examples/c2.jpg', 'examples/c3.jpg'],
|
196 |
inputs=credit_image_input,
|
197 |
+
outputs=None,
|
198 |
fn=credit_recognition
|
199 |
)
|
200 |
|
|
|
204 |
with gr.Column(scale=2):
|
205 |
image_result_output = gr.HTML()
|
206 |
|
207 |
+
credit_examples.outputs = [credit_result_output, image_result_output]
|
208 |
credit_recognition_button.click(credit_recognition, inputs=credit_image_input, outputs=[credit_result_output, image_result_output])
|
209 |
|
210 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|