Spaces:
Sleeping
Sleeping
fix: process pdf once
Browse files
app.py
CHANGED
@@ -166,9 +166,9 @@ with gr.Blocks() as demo:
|
|
166 |
|
167 |
def select_image(evt: gr.SelectData, gallery):
|
168 |
selected = gallery[evt.index]
|
169 |
-
return selected
|
170 |
|
171 |
-
image_gallery.select(select_image, image_gallery,
|
172 |
convert_button.click(convert_pdf_to_images, inputs=[pdf_input], outputs=[gr.Textbox(visible=False), image_gallery])
|
173 |
ocr_button.click(ocr_process, inputs=[selected_image, got_mode, ocr_color, ocr_box], outputs=ocr_output)
|
174 |
|
|
|
166 |
|
167 |
def select_image(evt: gr.SelectData, gallery):
|
168 |
selected = gallery[evt.index]
|
169 |
+
return selected
|
170 |
|
171 |
+
image_gallery.select(select_image, image_gallery, selected_image)
|
172 |
convert_button.click(convert_pdf_to_images, inputs=[pdf_input], outputs=[gr.Textbox(visible=False), image_gallery])
|
173 |
ocr_button.click(ocr_process, inputs=[selected_image, got_mode, ocr_color, ocr_box], outputs=ocr_output)
|
174 |
|