feat: add OCR engine abstraction layer (refs #116)
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>
This commit is contained in:
27
ocr/app/engines/__init__.py
Normal file
27
ocr/app/engines/__init__.py
Normal file
@@ -0,0 +1,27 @@
|
||||
"""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",
|
||||
]
|
||||
Reference in New Issue
Block a user