tetrak_ocr.backends.paddle

OCR a single image file using PaddleOCR and return the extracted text.

PaddleOCR is Baidu’s open-source OCR toolkit, based on the PaddlePaddle deep learning framework. It uses a three-stage pipeline: text detection (DBNet), text orientation classification, and text recognition (SVTR/PP-OCRv4).

On first run the model weights are downloaded automatically (~100 MB). They are cached in ~/.paddleocr/ and reused on subsequent calls.

Requires:

pip install paddleocr paddlepaddle

Usage (standalone):

tetrak-ocr ocr workspace/scans/my-postcard.jpg –backend paddle

No preprocessing is applied; PaddleOCR’s neural pipeline handles varied contrast and layouts internally. PDF support is not included; convert PDFs to images first.

Functions

ocr_image(path)

Extract text from an image file using PaddleOCR.