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:

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
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for MoraxCheng/ohmyshot-ppocrv6-small-coreml

Quantized
(1)
this model