Update app.py
Browse files
app.py
CHANGED
@@ -64,18 +64,19 @@ description = '<p>Using Donut model finetuned on Invoices for retrieval of follo
|
|
64 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2111.15664' target='_blank'>Donut: OCR-free Document Understanding Transformer</a> | <a href='https://github.com/clovaai/donut' target='_blank'>Github Repo</a></p>"
|
65 |
|
66 |
|
67 |
-
gr_image = gr.Image().style( height=800)
|
68 |
|
69 |
#demo = gr.Interface(fn=process_document,inputs=gr_image,outputs="json",title="Demo: Donut 🍩 for invoice header retrieval", description=description,
|
70 |
# article=article,enable_queue=True, examples=[["example.jpg"], ["example_2.jpg"], ["example_3.jpg"]], cache_examples=False)
|
71 |
|
72 |
with gr.Blocks() as demo:
|
73 |
gr.Markdown(description)
|
74 |
-
with gr.Row():
|
75 |
-
inp = gr.Image().style(height=800)
|
76 |
-
out = gr.JSON()
|
77 |
btn = gr.Button("Run")
|
78 |
-
gr.
|
|
|
|
|
|
|
|
|
|
|
79 |
btn.click(fn=process_document, inputs=inp, outputs=out)
|
80 |
|
81 |
demo.launch()
|
|
|
64 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2111.15664' target='_blank'>Donut: OCR-free Document Understanding Transformer</a> | <a href='https://github.com/clovaai/donut' target='_blank'>Github Repo</a></p>"
|
65 |
|
66 |
|
|
|
67 |
|
68 |
#demo = gr.Interface(fn=process_document,inputs=gr_image,outputs="json",title="Demo: Donut 🍩 for invoice header retrieval", description=description,
|
69 |
# article=article,enable_queue=True, examples=[["example.jpg"], ["example_2.jpg"], ["example_3.jpg"]], cache_examples=False)
|
70 |
|
71 |
with gr.Blocks() as demo:
|
72 |
gr.Markdown(description)
|
|
|
|
|
|
|
73 |
btn = gr.Button("Run")
|
74 |
+
with gr.Row():
|
75 |
+
with gr.Column(scale=4, min_width=600):
|
76 |
+
inp = gr.Image().style(height=800)
|
77 |
+
with gr.Column():
|
78 |
+
out = gr.JSON()
|
79 |
+
gr.Examples([["example.jpg"], ["example_2.jpg"], ["example_3.jpg"]], inputs=[inp])
|
80 |
btn.click(fn=process_document, inputs=inp, outputs=out)
|
81 |
|
82 |
demo.launch()
|