Skip to content

API Reference parrot_loaders.ocr.easyocr_backend

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_loaders.ocr.easyocr_backend

View source

EasyOCR backend for parrot_loaders.

Wraps the easyocr library to provide GPU-friendly, multi-language OCR. EasyOCR returns bounding boxes as four-corner polygons (similar to PaddleOCR), which are converted to axis-aligned (x1, y1, x2, y2) rectangles.

Important: the file is named easyocr_backend.py (not easyocr.py) to avoid shadowing the easyocr package itself.

Class EasyOCRBackend

OCR backend using EasyOCR with optional GPU acceleration.

EasyOCR natively supports CUDA. GPU usage is auto-detected from torch.cuda.is_available() and can be overridden by setting EASYOCR_GPU=0 in the environment before instantiation.

A single :class:easyocr.Reader instance is kept per backend object; readers are expensive to initialise (model download on first use).

Parameter Type Default Description
language str 'en' ISO 639-1 language code (e.g. "en"). Passed to easyocr.Reader as a single-element list.

Method EasyOCRBackend.extract

Extract text blocks from image using EasyOCR.

extract(image: Image.Image, language: str = 'en') -> List[OCRBlock]

Parameter Type Default Description
image Image.Image A PIL/Pillow image to analyse.
language str 'en' ISO 639-1 language code. Note that the Reader was initialised with the language passed to __init__; this parameter is accepted for API compatibility but only used if it matches the reader's language.

Returns: List[OCRBlock] — A list of :class:OCRBlock instances, one per EasyOCR detection, in the order returned by the reader.

Alias OCRBlock

Re-exported from parrot_loaders.ocr.models.OCRBlock.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally