From 22b57d632d56095e155076c8af2d59578a017313 Mon Sep 17 00:00:00 2001 From: tink2123 Date: Wed, 25 Aug 2021 09:41:16 +0000 Subject: [PATCH] fix infer shape --- tools/infer/predict_rec.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/infer/predict_rec.py b/tools/infer/predict_rec.py index d700b5c0..7401a16e 100755 --- a/tools/infer/predict_rec.py +++ b/tools/infer/predict_rec.py @@ -88,9 +88,8 @@ class TextRecognizer(object): def resize_norm_img(self, img, max_wh_ratio): 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)) + max_wh_ratio = max(max_wh_ratio, imgW / imgH) + imgW = int((32 * max_wh_ratio)) h, w = img.shape[:2] ratio = w / float(h) if math.ceil(imgH * ratio) > imgW: -- GitLab