fixes for paddle ocr

This commit is contained in:
yadonglu
2024-10-31 15:18:12 -07:00
parent 612785d1c0
commit b094079a06
7 changed files with 117 additions and 138 deletions

2
.gitignore vendored
View File

@@ -2,4 +2,4 @@ weights/icon_caption_blip2
weights/icon_caption_florence weights/icon_caption_florence
weights/icon_detect/ weights/icon_detect/
.gradio .gradio
__pycache__ __pycache__/

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -90,7 +90,7 @@ with gr.Blocks() as demo:
iou_threshold_component = gr.Slider( iou_threshold_component = gr.Slider(
label='IOU Threshold', minimum=0.01, maximum=1.0, step=0.01, value=0.1) label='IOU Threshold', minimum=0.01, maximum=1.0, step=0.01, value=0.1)
use_paddleocr_component = gr.Checkbox( use_paddleocr_component = gr.Checkbox(
label='Use PaddleOCR', default=True) label='Use PaddleOCR', value=True)
submit_button_component = gr.Button( submit_button_component = gr.Button(
value='Submit', variant='primary') value='Submit', variant='primary')
with gr.Column(): with gr.Column():

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 KiB

After

Width:  |  Height:  |  Size: 219 KiB

View File

@@ -411,7 +411,7 @@ def check_ocr_box(image_path, display_img = True, output_bb_format='xywh', goal_
elif output_bb_format == 'xyxy': elif output_bb_format == 'xyxy':
bb = [get_xyxy(item) for item in coord] bb = [get_xyxy(item) for item in coord]
# print('bounding box!!!', bb) # print('bounding box!!!', bb)
return (text, bb), is_goal_filtered return (text, bb), goal_filtering