PP-OCRv6 small for Core ML (OhMyShot model pack)
PaddlePaddle's PP-OCRv6 small text detection and recognition models, converted to Core ML ML programs (16-bit floating point) for OhMyShot, a screenshot app for macOS, which downloads them as a model pack to read text that macOS's own text recognition reads poorly (Chinese-heavy interfaces, low-confidence regions). The weights are PaddlePaddle's, unchanged; see LICENSE.txt for the license and what was changed.
| File | What it is |
|---|---|
det.mlpackage |
Text detection (DB): input x, 1 × 3 × H × W, output prob, 1 × 1 × H × W. Sizes: 640×640, 640×1280, 640×2560, 640×4096, 1280×640, 1280×1280, 1280×2560, 1280×4096. |
rec.mlpackage |
Text recognition (CTC) up to its last layer: input x, 1 × 3 × 48 × W, output features, 1 × W/8 × 120. Widths: 160, 320, 480, 640, 800, 960, 1280, 1600, 2000, 2400, 3200, 4000. |
head.bin |
The recognizer's last layer, a linear map from the 120 features to 18,710 classes: its weights (18,710 × 120, row by row), then its 18,710 biases, little-endian 16-bit floats. A softmax over its output gives the classes' probabilities. |
characters.txt |
The recognition model's characters, one a line: class 1 is the first line; class 0 is the blank and the class after the last line a space. |
config.json |
Pre- and post-processing: normalization, the bands a region is read in, detection thresholds. |
LICENSE.txt |
Apache License 2.0, with what was changed. |
Inputs are padded with zeros up to the smallest listed size that holds them. Run on the CPU and the Neural Engine
(.cpuAndNeuralEngine); macOS 27 beta's GPU path fails on these models.
This is version 2 of the pack (config.json format 2). Version 1's recognizer ended in the last layer and its softmax;
on the Neural Engine its output, a probability for each class at every step, crossed to the CPU, and Core ML kept
that crossing's memory for every width a reader used. Applied on the CPU instead, the last layer reads the same text
with a fraction of the memory.
Made with Tools/model-packs/ppocr_pack.py from these upstream revisions, and checked against PaddlePaddle's ONNX
exports of the same models:
- https://huggingface.co/PaddlePaddle/PP-OCRv6_small_det_safetensors/tree/eae2ee920a39fb3087637d3dbb58df1896ec1f24
- https://huggingface.co/PaddlePaddle/PP-OCRv6_small_rec_safetensors/tree/fe049fb103f57443fe8840c54ed06b702f3c1de5
- https://huggingface.co/PaddlePaddle/PP-OCRv6_small_det_onnx/tree/28fe5895c24fd108c19eb3e8479f4ab385fbfc62
- https://huggingface.co/PaddlePaddle/PP-OCRv6_small_rec_onnx/tree/b8f84f0b80c529de40b4fbb3544b84fa7233a513
Checked against the OhMyShot OCR benchmark (40 cases, 12 of them crops of real screenshots): every case read, mean content character error rate 2.40% over the 38 cases scored, against 2.59% for the same models at any input size with PaddlePaddle's own pre- and post-processing. Korean (not in the model) and vertical Chinese (read right, but scored in another order) are left out of both.
- Downloads last month
- 74
Model tree for MoraxCheng/ohmyshot-ppocrv6-small-coreml
Base model
PaddlePaddle/PP-OCRv6_small_det_safetensors