ducpy.search.image_ocr¶
Server-side image OCR helpers for DUC search.
Uses rapidocr-onnxruntime with custom PP-OCRv6_tiny ONNX models when the ocr extra is installed, otherwise
OCR is gracefully skipped.
Attributes¶
Functions¶
|
Return whether the |
|
|
|
|
|
OCR an image using the |
Module Contents¶
- ducpy.search.image_ocr.logger¶
- ducpy.search.image_ocr._RAPID_OCR_ENGINE: Any | None = None¶
- ducpy.search.image_ocr.server_side_ocr_available() bool¶
Return whether the
ocrextra (RapidOCR) is installed and usable.
- ducpy.search.image_ocr._get_local_cache_dir(repo_id: str) str | None¶
- ducpy.search.image_ocr._get_rapid_engine() Any¶
- ducpy.search.image_ocr.extract_image_text_with_ocr(image_bytes: bytes, *, ocr_language: str) tuple[str, bool]¶
OCR an image using the
ocrextra, or skip when unavailable.
- ducpy.search.image_ocr._server_side_ocr_available¶
- ducpy.search.image_ocr._extract_image_text_with_ocr¶