Skip to content

API Reference parrot_loaders.ocr.paddle

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

parrot_loaders.ocr.paddle

View source

PaddleOCR Backend for ImageLoader.

Wraps the PaddleOCR library behind the OCRBackend protocol. PaddleOCR provides high-quality text detection + recognition with angle classification. It is the primary/default OCR backend.

This module is an optional dependency. Import errors are raised with clear instructions only when the backend is actually instantiated.

Alias OCRBlock

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

Class PaddleOCRBackend

OCR backend using PaddleOCR.

Provides high-quality text extraction with bounding boxes. Supports angle classification for rotated text and multiple languages.

The paddleocr and paddlepaddle packages must be installed: pip install paddleocr paddlepaddle

Parameter Type Default Description
language str 'en' PaddleOCR language code (e.g., "en", "ch", "fr"). The mapping from ISO codes to PaddleOCR codes is handled internally.

Method PaddleOCRBackend.extract

Run PaddleOCR on an image and return text blocks.

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

Parameter Type Default Description
image Image.Image PIL Image to process.
language str 'en' Language override for this call. Defaults to the language specified at construction time.

Returns: List[OCRBlock] — List of OCRBlock objects with text, bounding boxes, and confidence scores. Blocks with very low confidence (< 0.1) are filtered out as noise.

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