From 3849497861de7801294f4ed91bb4429d5745f7f9 Mon Sep 17 00:00:00 2001 From: Jo Date: Mon, 5 Feb 2024 08:57:47 +0100 Subject: [PATCH] fix ocr return exception if image is empty (#170) --- src/utils/ocr/read.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/ocr/read.py b/src/utils/ocr/read.py index 400726c1..c044db99 100644 --- a/src/utils/ocr/read.py +++ b/src/utils/ocr/read.py @@ -71,7 +71,7 @@ def image_to_text(img: np.ndarray, line_boxes: bool = False, do_pre_proc: bool = if img is None or len(img) == 0: Logger.warning("img provided to image_to_text() is empty!") - return "", [] if line_boxes else "" + return OcrResult(), [] if line_boxes else "" if do_pre_proc: pre_proced_img = pre_proc_img(img)