diff --git a/tools/infer/predict_rec.py b/tools/infer/predict_rec.py index c8c0797b499055ec681d0362a054a30d7322b65a..a3f68f04c984c6fe50f6340d203f512cde858502 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 8b0abd706cd60a23753a4b53915a0fe5fdaa66e4..3953fa0df76c3929a52af39901f7eeb0569c68b2 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):