diff --git a/table_transformer_detection/app.py b/table_transformer_detection/app.py
index b8138d2..7e346bc 100644
--- a/table_transformer_detection/app.py
+++ b/table_transformer_detection/app.py
@@ -28,19 +28,33 @@ def inference(img):
)
-title = "object detection:table-transformer-detection"
-description = "Gradio Demo for table-transformer-detection. To use it, simply upload your image, or click one of the examples to load them."
+#title = "#object detection:table-transformer-detection"
+#description = "Gradio Demo for table-transformer-detection. To use it, simply upload your image, or click one of the examples to load them."
article = "
Github Repo Pytorch
"
examples=[['example_pdf.png']]
-demo = gr.Interface(
- fn=inference,
- inputs=[gr.inputs.Image(type="pil")],
- outputs=gr.outputs.Textbox(),
- title=title,
- description=description,
- article=article,
- examples=examples)
+with gr.Blocks() as demo:
+ gr.Markdown(
+ """
+ # object detection:table-transformer-detection
+ Gradio Demo for table-transformer-detection. To use it, simply upload your image, or click one of the examples to load them.
+ """)
+ with gr.Row():
+ image_input = gr.Image(type="pil")
+ image_output = gr.Textbox()
+ image_button = gr.Button("上传")
+ image_button.click(inference, inputs=image_input, outputs=image_output)
+ gr.Examples(examples,inputs=image_input)
+
+# demo = gr.Interface(
+# fn=inference,
+# inputs=[gr.inputs.Image(type="pil")],
+# outputs=gr.outputs.Textbox(),
+# title=title,
+# description=description,
+# article=article,
+# examples=examples)
+
demo.launch()
\ No newline at end of file