Commit
•
09eb282
1
Parent(s):
53f3fb4
update_ocr_postprocess (#11)
Browse files- update ocr post-process (5fe6a7907de0bc310f141c5f63a83f527efbcf68)
Co-authored-by: Haiping Wu <haipingwu@users.noreply.huggingface.co>
- processing_florence2.py +3 -3
processing_florence2.py
CHANGED
@@ -596,7 +596,7 @@ class Florence2PostProcesser(object):
|
|
596 |
{
|
597 |
'TASK_NAME': 'ocr',
|
598 |
'PATTERN': r'(.+?)<loc_(\d+)><loc_(\d+)><loc_(\d+)><loc_(\d+)><loc_(\d+)><loc_(\d+)><loc_(\d+)><loc_(\d+)>',
|
599 |
-
'AREA_THRESHOLD': 0.
|
600 |
},
|
601 |
{
|
602 |
'TASK_NAME': 'phrase_grounding',
|
@@ -1025,7 +1025,7 @@ class Florence2PostProcesser(object):
|
|
1025 |
text,
|
1026 |
pattern=pattern,
|
1027 |
image_size=image_size,
|
1028 |
-
area_threshold=self.parse_tasks_configs[task].get('AREA_THRESHOLD', 0.
|
1029 |
)
|
1030 |
parsed_dict['ocr'] = instances
|
1031 |
elif task == 'phrase_grounding':
|
@@ -1085,4 +1085,4 @@ class Florence2PostProcesser(object):
|
|
1085 |
else:
|
1086 |
raise ValueError("task {} is not supported".format(task))
|
1087 |
|
1088 |
-
return parsed_dict
|
|
|
596 |
{
|
597 |
'TASK_NAME': 'ocr',
|
598 |
'PATTERN': r'(.+?)<loc_(\d+)><loc_(\d+)><loc_(\d+)><loc_(\d+)><loc_(\d+)><loc_(\d+)><loc_(\d+)><loc_(\d+)>',
|
599 |
+
'AREA_THRESHOLD': 0.00
|
600 |
},
|
601 |
{
|
602 |
'TASK_NAME': 'phrase_grounding',
|
|
|
1025 |
text,
|
1026 |
pattern=pattern,
|
1027 |
image_size=image_size,
|
1028 |
+
area_threshold=self.parse_tasks_configs[task].get('AREA_THRESHOLD', 0.0),
|
1029 |
)
|
1030 |
parsed_dict['ocr'] = instances
|
1031 |
elif task == 'phrase_grounding':
|
|
|
1085 |
else:
|
1086 |
raise ValueError("task {} is not supported".format(task))
|
1087 |
|
1088 |
+
return parsed_dict
|