Skip to main content

What is EasyOCR?

Ready-to-use OCR with 80+ supported languages using deep learning models. Best for multi-language support with high accuracy.

Usage

from upsonic.ocr import OCR
from upsonic.ocr.layer_1.engines import EasyOCREngine
# Also available: from upsonic.ocr import EasyOCREngine

# Create engine instance
engine = EasyOCREngine(languages=['en'], gpu=True, rotation_fix=True)

# Create OCR orchestrator
ocr = OCR(layer_1_ocr_engine=engine)

# Extract text
text = ocr.get_text('document.pdf')
print(text)

# Get detailed results
result = ocr.process_file('image.png')
print(f"Confidence: {result.confidence:.2%}")
for block in result.blocks:
    print(f"Text: {block.text}, Confidence: {block.confidence:.2%}")

Parameters

ParameterTypeDefaultDescription
languagesList[str]['en']List of language codes to detect
gpuboolFalseEnable GPU acceleration for faster processing
rotation_fixboolFalseAuto-detect and fix image rotation
enhance_contrastboolFalseEnhance image contrast
remove_noiseboolFalseApply noise reduction
confidence_thresholdfloat0.0Minimum confidence for text blocks
paragraphboolFalseGroup text into paragraphs
min_sizeint10Minimum text region size
text_thresholdfloat0.7Text detection threshold

Supported Languages

EasyOCR supports 80+ languages. You can find the full list of supported languages in the EasyOCR repository.