Spaces:
Running
Running
Commit
·
7e58b9d
1
Parent(s):
be84858
Show original
Browse files
app.py
CHANGED
|
@@ -94,7 +94,7 @@ def inference(pdf_path, page_num):
|
|
| 94 |
page_image = images[0]
|
| 95 |
paddle_ocr = get_paddle_ocr(page_image)
|
| 96 |
smoldocling_ocr = get_smoldocling_ocr(page_image)
|
| 97 |
-
return docling_ocr, paddle_ocr, smoldocling_ocr
|
| 98 |
|
| 99 |
title = "OCR Arena"
|
| 100 |
description = "A simple Gradio interface to extract text from PDFs and compare OCR models"
|
|
@@ -118,9 +118,10 @@ with gr.Blocks(theme=gr.themes.Glass()) as demo:
|
|
| 118 |
clear_btn = gr.ClearButton(components=[pdf, page_num])
|
| 119 |
submit_btn = gr.Button("Submit", variant='primary')
|
| 120 |
|
| 121 |
-
submit_btn.click(inference, inputs=[pdf, page_num], outputs=[docling_ocr_out, paddle_ocr_out, smoldocling_ocr_out])
|
| 122 |
|
| 123 |
with gr.Column():
|
|
|
|
| 124 |
docling_ocr_out = gr.Textbox(label="Docling OCR Output", type="text")
|
| 125 |
paddle_ocr_out = gr.Textbox(label="Paddle OCR Output", type="text")
|
| 126 |
smoldocling_ocr_out = gr.Textbox(label="SmolDocling OCR Output", type="text")
|
|
|
|
| 94 |
page_image = images[0]
|
| 95 |
paddle_ocr = get_paddle_ocr(page_image)
|
| 96 |
smoldocling_ocr = get_smoldocling_ocr(page_image)
|
| 97 |
+
return page_image, docling_ocr, paddle_ocr, smoldocling_ocr
|
| 98 |
|
| 99 |
title = "OCR Arena"
|
| 100 |
description = "A simple Gradio interface to extract text from PDFs and compare OCR models"
|
|
|
|
| 118 |
clear_btn = gr.ClearButton(components=[pdf, page_num])
|
| 119 |
submit_btn = gr.Button("Submit", variant='primary')
|
| 120 |
|
| 121 |
+
submit_btn.click(inference, inputs=[pdf, page_num], outputs=[original, docling_ocr_out, paddle_ocr_out, smoldocling_ocr_out])
|
| 122 |
|
| 123 |
with gr.Column():
|
| 124 |
+
original = gr.Image(width=320, height=320, label="Original Page")
|
| 125 |
docling_ocr_out = gr.Textbox(label="Docling OCR Output", type="text")
|
| 126 |
paddle_ocr_out = gr.Textbox(label="Paddle OCR Output", type="text")
|
| 127 |
smoldocling_ocr_out = gr.Textbox(label="SmolDocling OCR Output", type="text")
|