From 33f302e5ff0e2b893a9b4d1c712e98fe3e5e5d84 Mon Sep 17 00:00:00 2001 From: WenmuZhou Date: Tue, 9 Feb 2021 13:36:38 +0800 Subject: [PATCH] support img_h < 32 --- ppocr/data/imaug/operators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ppocr/data/imaug/operators.py b/ppocr/data/imaug/operators.py index 8b9175cf..eacfdf3b 100644 --- a/ppocr/data/imaug/operators.py +++ b/ppocr/data/imaug/operators.py @@ -185,8 +185,8 @@ class DetResizeForTest(object): resize_h = int(h * ratio) resize_w = int(w * ratio) - resize_h = int(round(resize_h / 32) * 32) - resize_w = int(round(resize_w / 32) * 32) + resize_h = max(int(round(resize_h / 32) * 32), 32) + resize_w = max(int(round(resize_w / 32) * 32), 32) try: if int(resize_w) <= 0 or int(resize_h) <= 0: -- GitLab