From 3348bda098d7c0bc0f892da4c2b3d133a27222a3 Mon Sep 17 00:00:00 2001 From: Anyexyz Date: Mon, 18 Dec 2023 09:39:28 +0000 Subject: [PATCH] Update image resizing algorithm --- ddddocr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddddocr.py b/ddddocr.py index 7dce88a..8f7a11c 100644 --- a/ddddocr.py +++ b/ddddocr.py @@ -559,7 +559,7 @@ class DdddOcr(object): image = Image.open(io.BytesIO(img_bytes)) else: image = base64_to_image(img_base64) - image = image.resize((int(image.size[0] * (64 / image.size[1])), 64), Image.ANTIALIAS).convert('L') + image = image.resize((int(image.size[0] * (64 / image.size[1])), 64), Image.LANCZOS).convert('L') image = np.array(image).astype(np.float32) image = np.expand_dims(image, axis=0) / 255. image = (image - 0.5) / 0.5