Skip to content

Commit

Permalink
Merge pull request #6625 from ynjang/ynjang
Browse files Browse the repository at this point in the history
update sorted_boxes
  • Loading branch information
LDOUBLEV authored Jun 27, 2022
2 parents fe8d103 + 7862bfc commit 0438b40
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tools/infer/predict_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,14 @@ def sorted_boxes(dt_boxes):
_boxes = list(sorted_boxes)

for i in range(num_boxes - 1):
if abs(_boxes[i + 1][0][1] - _boxes[i][0][1]) < 10 and \
(_boxes[i + 1][0][0] < _boxes[i][0][0]):
tmp = _boxes[i]
_boxes[i] = _boxes[i + 1]
_boxes[i + 1] = tmp
for j in range(i, 0, -1):
if abs(_boxes[j + 1][0][1] - _boxes[j][0][1]) < 10 and \
(_boxes[j + 1][0][0] < _boxes[j][0][0]):
tmp = _boxes[j]
_boxes[j] = _boxes[j + 1]
_boxes[j + 1] = tmp
else:
break
return _boxes


Expand Down

0 comments on commit 0438b40

Please sign in to comment.