fix infer shape

pull/3808/head
tink2123 2021-08-25 07:34:23 +00:00
parent 68e52250f3
commit 7488bc1db5
1 changed files with 1 additions and 0 deletions

View File

@ -89,6 +89,7 @@ class TextRecognizer(object):
imgC, imgH, imgW = self.rec_image_shape
assert imgC == img.shape[2]
if self.character_type == "ch":
max_wh_ratio = max(max_wh_ratio, imgW / imgH)
imgW = int((32 * max_wh_ratio))
h, w = img.shape[:2]
ratio = w / float(h)