ERP-DocIQ / backend /app /ocr /backends /__init__.py
kenmandal's picture
Deploy ERP-DocIQ: agentic OCR + IDP (MiniCPM-V 8B, Tesseract)
32b00ed verified
Raw
History Blame Contribute Delete
926 Bytes
"""Pluggable OCR backends.
The OCR channel of the hybrid extractor is backend-agnostic. Each backend
implements `OCRBackend.extract(path) -> OCRBackendResult`. Selection is by name
(`OCR_BACKEND`) or a per-request override, with a graceful fallback chain so a
missing GPU / key / endpoint never breaks a run.
Backends:
β€’ minicpm β€” MiniCPM-V-4.6 via an OpenAI-compatible server (vLLM / llama.cpp)
β€’ cohere β€” a Cohere vision/OCR model from HuggingFace (transformers)
β€’ llamaparse β€” LlamaParse (LlamaCloud)
β€’ tesseract β€” Tesseract OCR
β€’ easyocr β€” EasyOCR
β€’ sidecar β€” deterministic offline fallback (reads <stem>.txt)
"""
from .base import OCRBackend, OCRBackendResult
from .registry import (
OCRRegistry,
build_ocr_registry,
list_backends,
)
__all__ = [
"OCRBackend",
"OCRBackendResult",
"OCRRegistry",
"build_ocr_registry",
"list_backends",
]