提交 2103753d 编写于 作者: L LDOUBLEV

sorted

上级 51640f62
...@@ -116,7 +116,10 @@ def sorted_boxes(dt_boxes): ...@@ -116,7 +116,10 @@ def sorted_boxes(dt_boxes):
sorted boxes(array) with shape [4, 2] sorted boxes(array) with shape [4, 2]
""" """
num_boxes = dt_boxes.shape[0] num_boxes = dt_boxes.shape[0]
sorted_boxes = sorted(dt_boxes, key=lambda x: (x[0][1], x[0][0])) if abs(num_boxes - 2) < 1e-4:
sorted_boxes = sorted(dt_boxes, key=lambda x: (x[1], x[0]))
else:
sorted_boxes = sorted(dt_boxes, key=lambda x: (x[0][1], x[0][0]))
_boxes = list(sorted_boxes) _boxes = list(sorted_boxes)
for i in range(num_boxes - 1): for i in range(num_boxes - 1):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册