From bb87fc8450df58f8951873d12ad1a1ca3d9c91ed Mon Sep 17 00:00:00 2001 From: SOULOFCINDER <841135647@qq.com> Date: Thu, 30 Mar 2023 14:52:10 +0800 Subject: [PATCH] update --- table_transformer_detection/app.py | 34 +++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 10 deletions(-) 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

visitor badge

" 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