remove unused function
This commit is contained in:
13
utils.py
13
utils.py
@@ -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
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user