Update module_ocr.py
Browse files- module_ocr.py +8 -8
module_ocr.py
CHANGED
|
@@ -161,8 +161,8 @@ with gr.Blocks() as demo:
|
|
| 161 |
label="Upload an image or a PDF file of a scanned document",
|
| 162 |
height=160
|
| 163 |
)
|
| 164 |
-
preview_image = gr.Image(label="Preview", show_label=True)
|
| 165 |
-
preview_text = gr.HTML(label="Status")
|
| 166 |
output_file = gr.File(
|
| 167 |
label="Download OCR'ed PDF",
|
| 168 |
visible=False # Initially not visible
|
|
@@ -170,7 +170,7 @@ with gr.Blocks() as demo:
|
|
| 170 |
with gr.Column():
|
| 171 |
output_text = gr.Textbox(label="OCR output")
|
| 172 |
|
| 173 |
-
# Input:
|
| 174 |
with gr.Row():
|
| 175 |
src_langs = gr.Dropdown(
|
| 176 |
label='Language(s) of document',
|
|
@@ -213,11 +213,11 @@ with gr.Blocks() as demo:
|
|
| 213 |
""")
|
| 214 |
|
| 215 |
# Update preview when file is uploaded
|
| 216 |
-
input_file.change(
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
)
|
| 221 |
|
| 222 |
# Functions
|
| 223 |
ocr_btn.click(
|
|
|
|
| 161 |
label="Upload an image or a PDF file of a scanned document",
|
| 162 |
height=160
|
| 163 |
)
|
| 164 |
+
#preview_image = gr.Image(label="Preview", show_label=True)
|
| 165 |
+
#preview_text = gr.HTML(label="Status")
|
| 166 |
output_file = gr.File(
|
| 167 |
label="Download OCR'ed PDF",
|
| 168 |
visible=False # Initially not visible
|
|
|
|
| 170 |
with gr.Column():
|
| 171 |
output_text = gr.Textbox(label="OCR output")
|
| 172 |
|
| 173 |
+
# Input: language(s) used in document, output types
|
| 174 |
with gr.Row():
|
| 175 |
src_langs = gr.Dropdown(
|
| 176 |
label='Language(s) of document',
|
|
|
|
| 213 |
""")
|
| 214 |
|
| 215 |
# Update preview when file is uploaded
|
| 216 |
+
#input_file.change(
|
| 217 |
+
# fn=preview_file,
|
| 218 |
+
# inputs=[input_file],
|
| 219 |
+
# outputs=[preview_image, preview_text]
|
| 220 |
+
#)
|
| 221 |
|
| 222 |
# Functions
|
| 223 |
ocr_btn.click(
|