From 3ab2d46310b3f6222b4be44a09f92dcaa32971c2 Mon Sep 17 00:00:00 2001 From: zhoujun Date: Tue, 9 Feb 2021 18:44:40 +0800 Subject: [PATCH] support img_h < 32 (#1992) --- 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