useOpticalCharacterRecognizer(
config,options?):object
Defined in: hooks/useOpticalCharacterRecognizer.ts:21
React hook for the PP-OCRv6 pipeline.
It downloads and loads the model, tracks progress and errors, instantiates the
task runner, and cleans up native memory on unmount or config change. Heavy
work runs on a worklet thread; recognizeCharacters resolves with the
recognized regions in reading order.
For imperative usage, see createPaddleOcr.
OCR model configuration. Use a preset from models.ocr.*.
Load and caching options. See ResourceOptions.
object
The same object as PaddleOcr (without dispose),
combined with loading state, download progress, and resource info.
downloadProgress:
number
error:
Error|undefined
isReady:
boolean=!!model
recognizeCharacters: (
input,options?) =>Promise<OcrDetection[]> |undefined=model.recognizeCharacters
recognizeCharactersWorklet: (
input,options?) =>OcrDetection[] |undefined=model.recognizeCharactersWorklet
resource:
PaddleOcrModel|undefined