Introduce pluggable OcrEngine ABC with PaddleOCR PP-OCRv4 as primary engine and Tesseract wrapper for backward compatibility. Engine factory reads OCR_PRIMARY_ENGINE config to instantiate the correct engine. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
28 lines
563 B
Python
28 lines
563 B
Python
"""OCR engine abstraction layer.
|
|
|
|
Provides a pluggable engine interface for OCR processing,
|
|
decoupling extractors from specific OCR libraries.
|
|
"""
|
|
|
|
from app.engines.base_engine import (
|
|
EngineError,
|
|
EngineProcessingError,
|
|
EngineUnavailableError,
|
|
OcrConfig,
|
|
OcrEngine,
|
|
OcrEngineResult,
|
|
WordBox,
|
|
)
|
|
from app.engines.engine_factory import create_engine
|
|
|
|
__all__ = [
|
|
"OcrEngine",
|
|
"OcrConfig",
|
|
"OcrEngineResult",
|
|
"WordBox",
|
|
"EngineError",
|
|
"EngineUnavailableError",
|
|
"EngineProcessingError",
|
|
"create_engine",
|
|
]
|