From 0758f913619ad5467b0480a78bcd84fd77332e3a Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Wed, 20 May 2020 16:05:46 +0800 Subject: [PATCH] modify batch num in rec and fix sorted_box func --- tools/infer/predict_rec.py | 2 +- tools/infer/predict_system.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/infer/predict_rec.py b/tools/infer/predict_rec.py index c8c0797b..a3f68f04 100755 --- a/tools/infer/predict_rec.py +++ b/tools/infer/predict_rec.py @@ -59,7 +59,7 @@ class TextRecognizer(object): def __call__(self, img_list): img_num = len(img_list) - batch_num = 30 + batch_num = 12 rec_res = [] predict_time = 0 for beg_img_no in range(0, img_num, batch_num): diff --git a/tools/infer/predict_system.py b/tools/infer/predict_system.py index 8b0abd70..3953fa0d 100755 --- a/tools/infer/predict_system.py +++ b/tools/infer/predict_system.py @@ -89,7 +89,7 @@ def sorted_boxes(dt_boxes): sorted boxes(array) with shape [4, 2] """ num_boxes = dt_boxes.shape[0] - sorted_boxes = sorted(dt_boxes, key=lambda x: x[0][1]) + sorted_boxes = sorted(dt_boxes, key=lambda x: (x[0][1], x[0][0])) _boxes = list(sorted_boxes) for i in range(num_boxes - 1): -- GitLab