Unverified Commit 3043f55e authored by Xiaomeng Zhao's avatar Xiaomeng Zhao Committed by GitHub
Browse files

Merge pull request #2831 from hzwzwzw/master

fix: duplicated removing high iou layout when scores are equal
parents 1db02e94 1f921b9d
...@@ -47,10 +47,10 @@ class MagicModel: ...@@ -47,10 +47,10 @@ class MagicModel:
def __fix_by_remove_high_iou_and_low_confidence(self): def __fix_by_remove_high_iou_and_low_confidence(self):
need_remove_list = [] need_remove_list = []
layout_dets = self.__page_model_info['layout_dets'] layout_dets = self.__page_model_info['layout_dets']
for layout_det1 in layout_dets: for i in range(len(layout_dets)):
for layout_det2 in layout_dets: for j in range(i + 1, len(layout_dets)):
if layout_det1 == layout_det2: layout_det1 = layout_dets[i]
continue layout_det2 = layout_dets[j]
if layout_det1['category_id'] in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] and layout_det2['category_id'] in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]: if layout_det1['category_id'] in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] and layout_det2['category_id'] in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]:
if ( if (
calculate_iou(layout_det1['bbox'], layout_det2['bbox']) calculate_iou(layout_det1['bbox'], layout_det2['bbox'])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment