Spaces:
Build error
Build error
update source
Browse files54 unmodified lines5556575859606162636465666768697054 unmodified linesprocessing_time = time.perf_counter() - startst.write(f"Box detection took {processing_time:.2f} seconds.")for box in boxes:org_image = cv2.polylines(org_image, [box.astype(np.int32)], isClosed=True, color=(0, 255, 0), thickness=2)image = transform_image(org_image, box)images.append(image)texts = text_engine(images)# Convert back to PIL Image for displayingoutput_image = Image.fromarray(cv2.cvtColor(org_image, cv2.COLOR_BGR2RGB))st.image(output_image, caption='Detected Text Boxes', use_column_width=True)st.write("Extracted Texts:")st.write(texts)54 unmodified lines55565758596061626364656667686970717254 unmodified linesprocessing_time = time.perf_counter() - startst.write(f"Box detection took {processing_time:.2f} seconds.")for box in boxes[::-1]:org_image = cv2.polylines(org_image, [box.astype(np.int32)], isClosed=True, color=(0, 255, 0), thickness=2)image = transform_image(org_image, box)images.append(image)st.image(output_image, caption='Detected Text Boxes', use_column_width=True)texts = text_engine(images)# Convert back to PIL Image for displayingoutput_image = Image.fromarray(cv2.cvtColor(org_image, cv2.COLOR_BGR2RGB))st.write("Extracted Texts:")st.write(texts)
app.py+4-2