mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-27 04:24:45 +00:00
add message for failed easyocr import
Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
parent
c28846a866
commit
81d176cd3d
@ -18,7 +18,12 @@ class EasyOcrModel(BaseOcrModel):
|
|||||||
self.scale = 3 # multiplier for 72 dpi == 216 dpi.
|
self.scale = 3 # multiplier for 72 dpi == 216 dpi.
|
||||||
|
|
||||||
if self.enabled:
|
if self.enabled:
|
||||||
import easyocr
|
try:
|
||||||
|
import easyocr
|
||||||
|
except ImportError:
|
||||||
|
raise ImportError(
|
||||||
|
"EasyOCR is not installed. Please install it via `pip install easyocr` to use this OCR engine."
|
||||||
|
)
|
||||||
|
|
||||||
self.reader = easyocr.Reader(lang_list=self.options.lang)
|
self.reader = easyocr.Reader(lang_list=self.options.lang)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user