Skip to content

OCR Pipeline

Kor Vision exports useOCR(), which wraps react-native-executorch OCR model execution.

import { useOCR } from '@korsolutions/vision';
export function OCRExample({ imageUri }: { imageUri: string }) {
const { execute } = useOCR();
async function run() {
const detections = await execute(imageUri);
console.log(detections);
}
return null;
}
  • Loads OCR model (OCR_ENGLISH) via ExecuTorch hook.
  • Runs inference against the provided image URI.
  • Streams detections and returns them as an array.
  1. Finalize document processing first (finalizeDocument()).
  2. Pass processedImageUri to execute(...).
  3. Persist parsed fields in your app domain model.
  4. Keep post-processing rules in your app layer (dates, totals, IDs).