React Native OCR - v0.11.0
    Preparing search index...

    Function useOcr

    • React hook for the OCR pipeline (EasyOCR or PaddleOCR). It downloads and loads the model, tracks progress and errors, instantiates the runner, and releases native memory on unmount or config change. Heavy work runs on a worklet thread; runOcr resolves with the recognized regions.

      For imperative usage, see createOcr.

      Type Parameters

      • L = never

        The layout region class-label type (from the layout model).

      Parameters

      • config: OcrModel<L>

        The OCR model. Use a preset from models.ocr.*.

      • Optionaloptions: ResourceOptions

        Load and caching options.

      Returns {
          downloadProgress: number;
          error: Error | undefined;
          isReady: boolean;
          resource: OcrModel<L> | undefined;
          runOcr:
              | (
                  (input: ImageBuffer, options?: RunOcrOptions) => Promise<OcrResult<L>>
              )
              | undefined;
          runOcrWorklet:
              | ((input: ImageBuffer, options?: RunOcrOptions) => OcrResult<L>)
              | undefined;
      }

      Readiness flags, download progress, and the runOcr and runOcrWorklet runners (undefined until the model is ready).