remove unused function

This commit is contained in:
Thomas Dhome-Casanova
2025-01-27 22:52:55 -08:00
parent cda4795270
commit 16570a9bf3

View File

@@ -540,17 +540,4 @@ def check_ocr_box(image_source: Union[str, Image.Image], display_img = True, out
bb = [get_xyxy(item) for item in coord] bb = [get_xyxy(item) for item in coord]
return (text, bb), goal_filtering return (text, bb), goal_filtering
def get_ocr_bbox(image: Image.Image):
if image.mode == 'RGBA':
# Convert RGBA to RGB to avoid alpha channel issues
image = image.convert('RGB')
image_np = np.array(image)
result = paddle_ocr.ocr(image_np, cls=False)[0]
text_threshold = 0.8
coord = [item[0] for item in result if item[1][1] > text_threshold]
text = [item[1][0] for item in result if item[1][1] > text_threshold]
bb = [get_xyxy(item) for item in coord]
return text, bb