OCR Pipeline
Kor Vision exports useOCR(), which wraps react-native-executorch OCR model execution.
Basic usage
Section titled “Basic usage”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;}How it works
Section titled “How it works”- Loads OCR model (
OCR_ENGLISH) via ExecuTorch hook. - Runs inference against the provided image URI.
- Streams detections and returns them as an array.
Recommended pattern
Section titled “Recommended pattern”- Finalize document processing first (
finalizeDocument()). - Pass
processedImageUritoexecute(...). - Persist parsed fields in your app domain model.
- Keep post-processing rules in your app layer (dates, totals, IDs).