From 880fad4e5f63abfddbd5ac071b686a3f74dd619d Mon Sep 17 00:00:00 2001 From: Tarun Menta Date: Mon, 10 Feb 2025 14:48:09 -0500 Subject: [PATCH] Fix streamlit app --- surya/scripts/streamlit_app.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/surya/scripts/streamlit_app.py b/surya/scripts/streamlit_app.py index bd6b0e2..7392cd2 100644 --- a/surya/scripts/streamlit_app.py +++ b/surya/scripts/streamlit_app.py @@ -69,7 +69,7 @@ def text_detection(img) -> (Image.Image, TextDetectionResult): text_pred = predictors["detection"]([img])[0] text_polygons = [p.polygon for p in text_pred.bboxes] det_img = draw_polys_on_image(text_polygons, img.copy()) - return det_img, text_pred, inline_pred + return det_img, text_pred def layout_detection(img) -> (Image.Image, LayoutResult): @@ -211,11 +211,10 @@ def page_counter(pdf_file): # Run Text Detection if run_text_det: - det_img, text_pred, inline_pred = text_detection(pil_image) + det_img, text_pred = text_detection(pil_image) with col1: st.image(det_img, caption="Detected Text", use_container_width=True) st.json(text_pred.model_dump(exclude=["heatmap", "affinity_map"]), expanded=True) - st.json(inline_pred.model_dump(exclude=["heatmap", "affinity_map"]), expanded=True) if run_inline_det: det_img, text_pred, inline_pred = inline_detection(pil_image)