PP-OCRv6 Medium Core ML
Core ML FP16 conversion of PaddlePaddle's PP-OCRv6 Medium text detection and recognition models, targeting iOS 17 and later.
Release
Use the v1.0.2 tag for this release. models/model-files.json contains the release version, relative file paths, exact byte sizes, SHA-256 checksums, and OCR settings. Artifact paths in the file list are relative to models/. OCR settings are stored in the settings object.
This release preserves every original resource byte from v1.0.1. Transfer files total 47,104,403 bytes; restored resources total 82,748,750 bytes. Entries with a download object are transferred at their original path plus .lzfse; other entries are transferred unchanged. The original size and sha256 describe restored files. The download object gives the transfer size, SHA-256 and compression (lzfse or shuffle16Lzfse). Each block contains two little-endian UInt32 lengths (restored and compressed), then LZFSE data, with at most 4 MiB restored per block. shuffle16Lzfse places even-position bytes before odd-position bytes within each block; reverse the shuffle after decompression. Verify transfer and restored SHA-256 checksums before loading.
Models
| Artifact | Input | Output |
|---|---|---|
PPOCRv6MediumDetSplit.mlmodelc |
Float32 BGR tensor, 1 x 3 x 1280 x 1280 | Float32 text probability map |
PPOCRv6MediumRec.mlmodelc |
Float32 BGR tensor, height 48; widths 320, 640, 960, 1280, 1920, 2560, 3200 | CTC character probabilities |
The models use FP16 weights and internal computation. Configure Core ML with MLComputeUnits.all to let the runtime select available compute devices. Device placement and latency depend on the device and OS.
Preprocessing and decoding
Resize detection images with the longest side at 1280, preserve the aspect ratio, normalize BGR channels using mean [0.485, 0.456, 0.406] and standard deviation [0.229, 0.224, 0.225], and zero-pad the normalized tensor to 1280 x 1280. Crop text lines from the oriented source image. Resize recognition crops to height 48, normalize BGR values to [-1, 1], and pad to a supported width. Decode using characters.json, CTC blank index 0, and repeated-token collapse.
Sources
| Model | Upstream repository | Pinned revision |
|---|---|---|
| Detection | PaddlePaddle/PP-OCRv6_medium_det_safetensors | 4236c2b61741a259c091fd879dcc4edc339e916c |
| Recognition | PaddlePaddle/PP-OCRv6_medium_rec_safetensors | 024cad6a831de75c2c3c26e711ba8c4a82ccd24b |
Converted with PyTorch 2.7.0, Transformers 5.20.2, coremltools 9.0, and Apple's Core ML compiler. The detector's 9 x 9 convolutions are represented by four spatial kernel tiles followed by summation. The mathematical convolution is preserved; FP16 rounding can change probabilities.
License
The original models are published by PaddlePaddle under Apache-2.0. The license is included as models/PaddleOCR-LICENSE.txt.