modify batch num in rec and fix sorted_box func

This commit is contained in:
LDOUBLEV 2020-05-20 16:05:46 +08:00
parent 4af8bd069a
commit 0758f91361
2 changed files with 2 additions and 2 deletions

View File

@ -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):

View File

@ -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):