From 5f85a05e8f8d01d0f4bec627564f5a2d87876bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ali=20Alt=C4=B1parmak?= Date: Wed, 23 Oct 2024 12:09:30 +0300 Subject: [PATCH] Fix ValueError: height and width must be > 0 --- rapid_latex_ocr/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rapid_latex_ocr/utils.py b/rapid_latex_ocr/utils.py index 5e73509..cb07423 100644 --- a/rapid_latex_ocr/utils.py +++ b/rapid_latex_ocr/utils.py @@ -75,6 +75,7 @@ def minmax_size( ratios = [a / b for a, b in zip(img.size, self.max_dims)] if any([r > 1 for r in ratios]): size = np.array(img.size) // max(ratios) + size = np.maximum(size, 1) img = img.resize(tuple(size.astype(int)), Image.BILINEAR) if self.min_dims is not None: