OCR (Optical Character Recognition) detects and recognizes text in images. React Native ExecuTorch provides both horizontal and vertical OCR capabilities with support for 80+ languages and scripts.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/software-mansion/react-native-executorch/llms.txt
Use this file to discover all available pages before exploring further.
Quick Start
Hook API
useOCR(props)
Manages an OCR pipeline (detector + recognizer) for horizontal text.
Parameters
Model configuration object
Prevent automatic model loading
Returns
Error object if loading or inference fails
Whether both models are loaded and ready
Whether OCR is currently processing
Combined download progress (0-1)
Perform OCR on an image. Returns array of text detections with bounding boxes, recognized text, and confidence scores.
useVerticalOCR(props)
Manages an OCR pipeline for vertical text (e.g., traditional Chinese, Japanese).
Additional Parameters
Treat each character independently during recognition
Supported Languages
React Native ExecuTorch supports 80+ languages across multiple scripts:Latin Script
Cyrillic Script
Asian Languages
Other Scripts
OCR Detection Type
Complete Example
Vertical OCR
For vertical text (traditional Chinese, Japanese):Use Cases
Document Scanning
Extract text from documents:Business Card Reader
Extract contact information:Receipt Parsing
Extract items and prices:Translation Aid
Extract foreign text for translation:Multilingual OCR
Switch languages dynamically:Performance Tips
Image Quality
Optimize images for better results:- Use high-resolution images (minimum 300 DPI for documents)
- Ensure good lighting and contrast
- Avoid skewed or rotated text
- Remove background noise
Preprocessing
Enhance images before OCR:Confidence Filtering
Filter low-confidence detections:Bounding Box Utilities
Work with detection polygons:Type Reference
Related
- Object Detection - Detect objects in images
- Classification - Categorize images
- Custom Models - Train custom OCR models