React Native
Headless OCR Prediction
The Vision SDK provides camera-independent OCR prediction methods through the VisionCore module that allow you to process existing images without requiring the camera view. These methods are ideal for workflows where you already have images and need to extract structured data from them.
For complete VisionCore API reference including setEnvironment() and model management methods, see the VisionCore Module Documentation and Model Management API.
Available Prediction Methods
1. On-Device Prediction
VisionCore.predictWithModule() — Recommended
Use the Model Management API for on-device predictions with explicit model selection.
2. Cloud Prediction Methods
Cloud predictions don't require downloading models - they process images on PackageX servers for higher accuracy.
VisionCore.predictShippingLabelCloud(imagePath, barcodes, options)
Processes shipping label images using cloud-based OCR with optional barcode data.
VisionCore.predictItemLabelCloud(imagePath, options)
Processes item label images for SKU, price, and product information extraction.
VisionCore.predictBillOfLadingCloud(imagePath, barcodes, options)
Processes bill of lading documents for carrier and shipment information.
VisionCore.predictDocumentClassificationCloud(imagePath, options)
Classifies and extracts data from various document types.
VisionCore.predictWithCloudTransformations(imagePath, barcodes, options)
Combines on-device processing with cloud-based transformations for enhanced accuracy.
Complete Example
Here's a complete example showing how to implement headless OCR prediction using VisionCore with the Model Management API:
Key Benefits
- Camera-Independent: Process existing images without requiring camera access
- Flexible Integration: Integrate OCR into any app workflow
- Fast Processing: On-device models provide quick results
- Cloud Accuracy: Cloud methods offer enhanced accuracy for complex documents
- Metadata Support: Pass custom metadata for enhanced processing context
Use Cases
- Gallery Processing: Allow users to select images from their photo library
- Batch Processing: Process multiple pre-captured images
- Server Integration: Process images received from servers or APIs
- Offline Analysis: Use on-device prediction when network is unavailable
- Quality Control: Re-process images that failed initial camera capture
API Reference
On-Device Methods
Cloud Methods
Further Reading
- Model Management API - Download, load, and manage on-device models
- VisionCore Module - Complete VisionCore API reference
- Logging APIs - Send prediction data to PackageX