From 309a4758d1f45b3f4c8e98dfb7bc70ac7248e646 Mon Sep 17 00:00:00 2001 From: Topdu <784990967@qq.com> Date: Tue, 14 Sep 2021 05:06:53 +0000 Subject: [PATCH] comment review --- tools/infer/predict_rec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/infer/predict_rec.py b/tools/infer/predict_rec.py index 5a7a6fae..332cffd5 100755 --- a/tools/infer/predict_rec.py +++ b/tools/infer/predict_rec.py @@ -94,7 +94,7 @@ class TextRecognizer(object): def resize_norm_img(self, img, max_wh_ratio): imgC, imgH, imgW = self.rec_image_shape - if imgC == 1: + if self.rec_algorithm == 'NRTR': img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # return padding_im image_pil = Image.fromarray(np.uint8(img))