EasyOCR engine implementation for OCR Bridge.
This package provides an EasyOCR engine that integrates with the OCR Bridge architecture. EasyOCR is a deep learning-based OCR engine with excellent support for Asian scripts and automatic GPU acceleration.
- 80+ Languages: Excellent support for Asian scripts (Chinese, Japanese, Korean, Thai, etc.)
- GPU Acceleration: Automatic GPU detection and usage with graceful CPU fallback
- Multiple Formats: JPEG, PNG, TIFF, PDF
- Deep Learning: Advanced neural network models for high accuracy
- HOCR Output: Structured XML with bounding boxes
pip install ocrbridge-easyocrNote: This will install PyTorch and EasyOCR dependencies (~2GB).
For GPU support, install CUDA-compatible PyTorch first:
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
pip install ocrbridge-easyocrThe engine is automatically discovered by OCR Bridge via entry points.
languages(list[str]): Language codes, e.g., ["en"], ["ch_sim", "en"] (default: ["en"])text_threshold(float): Confidence threshold for text detection 0.0-1.0 (default: 0.7)link_threshold(float): Threshold for linking text regions 0.0-1.0 (default: 0.7)
from pathlib import Path
from ocrbridge.engines.easyocr import EasyOCREngine, EasyOCRParams
engine = EasyOCREngine()
# Process with defaults (English)
hocr = engine.process(Path("document.pdf"))
# Process with custom parameters
params = EasyOCRParams(
languages=["ch_sim", "en"],
text_threshold=0.7,
link_threshold=0.7
)
hocr = engine.process(Path("chinese_document.pdf"), params)The engine automatically detects and uses GPU if available. No configuration needed!
0.1.0