Skip to content

Commit

Permalink
fix ocr return exception if image is empty (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeon0 authored Feb 5, 2024
1 parent f425d89 commit 3849497
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/ocr/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3849497

Please sign in to comment.