diff --git a/ppocr/data/det/db_process.py b/ppocr/data/det/db_process.py index faca9ac20967623f62d64c5394d1ed397b55cbf1..80762c7c7303230284b9b966affc04e90d623c65 100644 --- a/ppocr/data/det/db_process.py +++ b/ppocr/data/det/db_process.py @@ -143,12 +143,16 @@ class DBProcessTest(object): resize_w = int(resize_w * ratio) if resize_h % 32 == 0: resize_h = resize_h + elif resize_h // 32 <= 1: + resize_h = 32 else: - resize_h = (resize_h // 32 + 1) * 32 + resize_h = (resize_h // 32 - 1) * 32 if resize_w % 32 == 0: resize_w = resize_w + elif resize_w // 32 <= 1: + resize_w = 32 else: - resize_w = (resize_w // 32 + 1) * 32 + resize_w = (resize_w // 32 - 1) * 32 try: if int(resize_w) <= 0 or int(resize_h) <= 0: return None, (None, None) diff --git a/ppocr/data/det/east_process.py b/ppocr/data/det/east_process.py index 019eef57abf1833f4b201cf207a8e2da3ad41dbc..5f52da4c2496b5e38050d6e6ee05e3f3df4cbb1a 100755 --- a/ppocr/data/det/east_process.py +++ b/ppocr/data/det/east_process.py @@ -485,10 +485,14 @@ class EASTProcessTest(object): resize_w = int(resize_w * ratio) if resize_h % 32 == 0: resize_h = resize_h + elif resize_h // 32 <= 1: + resize_h = 32 else: resize_h = (resize_h // 32 - 1) * 32 if resize_w % 32 == 0: resize_w = resize_w + elif resize_w // 32 <= 1: + resize_w = 32 else: resize_w = (resize_w // 32 - 1) * 32 im = cv2.resize(im, (int(resize_w), int(resize_h)))