Views
No views yet
.pte per backend for the ExecuTorch runtime
(XNNPACK, CoreML, Vulkan). These are document pre/post-processing companions to
react-native-executorch-pp-ocrv6 —
not an OCR model on their own.<backend>/config.json # per-backend spec
<backend>/paddle_helpers_<backend>_<precision>.pte.pte exposes four methods (the .pte is pure tensor→tensor; the client
does normalization, argmax/softmax, grid-sampling and the decode loop). All methods are
fixed-shape — the exact input shapes below are also declared in config.json, and since
nothing here is dynamic the model carries no get_model_schema overrides; a client reads the
signatures straight from ExecuTorch's MethodMeta.| method | source model | input | output | purpose |
|---|---|---|---|---|
orientation | PP-LCNet doc_ori | [1,3,224,224] | logits[1,4] | page rotation 0 / 90 / 180 / 270° (argmax) |
dewarp | UVDoc | [1,3,712,488] | grid[1,2,45,31] | sampling grid → grid_sample to unwarp a curved/folded page |
table_encode | SLANet_plus | [1,3,488,488] | feat[1,256,96] | encode a cropped table image (run once) |
table_decode_step | SLANet_plus decoder | (feat[1,256,96], hidden[1,256], onehot[1,50]) | (probs[1,50], hidden[1,256]) | one autoregressive structure-token step |
table_encode once,
then call table_decode_step per token, feeding the previous step's hidden state back in and
the chosen token back as a one-hot. The first step takes an all-zero one-hot — the exported
decoder embeds its own start token.| backend | target | precision | size | orientation / table_encode / dewarp / decode_step |
|---|---|---|---|---|
xnnpack | CPU | dynamic int8 (qd8 — lossless; static int8 is lossy on the regressors) | ~28 MB | 2.0 / 30 / 209 / 0.21 ms (Galaxy S24) |
coreml | Apple ANE | weight-only int8 | 11.9 MB | 0.3 / 1.4 / 4.7 / 0.13 ms (Apple M-series ANE) |
vulkan | Android GPU | fp16, except the table path → XNNPACK (mixed-delegate) | 23 MB | 6.0 / 17 / 66 / 0.21 ms (Galaxy S24) |
orientation and the dispatch-bound
autoregressive table_decode_step are faster on CPU — hence the Vulkan build routes the
table path to XNNPACK.table_decode_step is always computed at full precision on CPU (autoregressive stability)..pte files. For more details, see
the compatibility note in the
ExecuTorch GitHub repository.
If you work with React Native ExecuTorch, the library constants guarantee compatibility with the
runtime used behind the scenes.