Three-stage OCR pipeline optimized for Apple Silicon CPU and GPU:
Component
Architecture
Parameters
Detector
RegNet-X-8GF + ASPP + FPN
~43M
Recognizer
CNN encoder + Transformer decoder
~6M
Relational
Graph neural network + Transformer
~2M
Variants
Variant
Charset
Vocab Size
Recognizer Seq Length
v2_english
855 characters
858 tokens
32
v2_multilingual
~42K characters
~42K tokens
512
Device-Tuned Presets
Device
Detector Resolution
dtype
Notes
GPU
512×512
bfloat16
Best throughput on Apple Silicon GPU via Metal
CPU
256×256
float32
Reduced resolution avoids expensive full-res CPU inference
Usage with SwiftNemotronOCR
This model is designed for use with SwiftNemotronOCR, an all-Swift OCR pipeline.
Quick Start
bash
1# Clone the Swift package2git clone https://github.com/mweinbach/SwiftNemotronOCR.git
3cd SwiftNemotronOCR
45# Build6swift build -c release
78# Compile Metal shaders (required for swift build — see repo README)9# ... (see SwiftNemotronOCR README for the metallib build step)1011# Download this model12# Place v2_english/ and/or v2_multilingual/ under a model/mlx/ directory1314# Run OCR on GPU15.build/release/apple-ocr-runner \16 --runtime mlx \17 --device GPU \18 --model-dir /path/to/model/mlx \19 --image /path/to/image.png \20 --variant en \21 --level paragraph
Output
JSON with detected text regions, confidence scores, and bounding quads: