Skip to main content
Version: 0.10.0

Function: createPaddleOcr()

createPaddleOcr(config, runtime?): Promise<PaddleOcr>

Defined in: extensions/cv/tasks/paddleOcr.ts:400

Creates the PP-OCRv6 runner: one pass detects text quads on the whole page, warps each to the recognizer canvas and reads it, returning the lines in reading order.

Parameters​

config​

PaddleOcrModel

PaddleOCR task configuration containing the model, charset, and detection thresholds. See PaddleOcrModel.

runtime?​

WorkletRuntime

Optional worklet runtime thread on which to run detection and recognition.

Returns​

Promise<PaddleOcr>

A promise resolving to the instantiated PaddleOcr runner.

Throws​

With code LOAD_FAILED if the model or charset fails to load, SCHEMA_MISMATCH if the loaded model does not match the PP-OCRv6 detect/recognize contract, or if the charset does not match the recognizer's vocabulary.