Skip to content

Latest commit

 

History

History
38 lines (23 loc) · 1.23 KB

File metadata and controls

38 lines (23 loc) · 1.23 KB

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.