From d72329ca6ae15a8b8a2ae561f9c9b20ab7b748fa Mon Sep 17 00:00:00 2001 From: jyn47 Date: Fri, 17 Jun 2022 16:56:25 +0900 Subject: [PATCH 1/2] predict_system.py update --- tools/infer/predict_system.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/infer/predict_system.py b/tools/infer/predict_system.py index 625d365f45..59ba4644d6 100755 --- a/tools/infer/predict_system.py +++ b/tools/infer/predict_system.py @@ -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]) < 20 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 From 7862bfc748dec7bb86e8937ae81f08f157c4d952 Mon Sep 17 00:00:00 2001 From: jyn47 Date: Fri, 17 Jun 2022 17:41:33 +0900 Subject: [PATCH 2/2] update predict_system.py --- tools/infer/predict_system.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/infer/predict_system.py b/tools/infer/predict_system.py index 59ba4644d6..abeb91bc25 100755 --- a/tools/infer/predict_system.py +++ b/tools/infer/predict_system.py @@ -115,7 +115,7 @@ def sorted_boxes(dt_boxes): for i in range(num_boxes - 1): for j in range(i, 0, -1): - if abs(_boxes[j + 1][0][1] - _boxes[j][0][1]) < 20 and \ + 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]