Commit fe34b1a2 authored by 赵小蒙's avatar 赵小蒙

magic_model return block with scroe

parent 536300fd
...@@ -45,8 +45,8 @@ class MagicModel: ...@@ -45,8 +45,8 @@ class MagicModel:
int(y1 / vertical_scale_ratio), int(y1 / vertical_scale_ratio),
] ]
layout_det["bbox"] = bbox layout_det["bbox"] = bbox
# 删除高度或者宽度0的spans # 删除高度或者宽度小于等于0的spans
if bbox[2] - bbox[0] == 0 or bbox[3] - bbox[1] == 0: if bbox[2] - bbox[0] <= 0 or bbox[3] - bbox[1] <= 0:
need_remove_list.append(layout_det) need_remove_list.append(layout_det)
for need_remove in need_remove_list: for need_remove in need_remove_list:
layout_dets.remove(need_remove) layout_dets.remove(need_remove)
...@@ -546,7 +546,10 @@ class MagicModel: ...@@ -546,7 +546,10 @@ class MagicModel:
bbox = item.get("bbox", None) bbox = item.get("bbox", None)
if category_id == type: if category_id == type:
block = {"bbox": bbox} block = {
"bbox": bbox,
"score": item.get("score"),
}
for col in extra_col: for col in extra_col:
block[col] = item.get(col, None) block[col] = item.get(col, None)
blocks.append(block) blocks.append(block)
......
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