fixed the readmes
Browse files
README.md
CHANGED
|
@@ -8,7 +8,7 @@ classification, dewarping, and table-structure recognition — for the
|
|
| 8 |
[React Native ExecuTorch](https://www.npmjs.com/package/react-native-executorch) library,
|
| 9 |
fused into **one multi-method `.pte`** per backend for the **ExecuTorch** runtime
|
| 10 |
(XNNPACK, CoreML, Vulkan). These are document pre/post-processing companions to
|
| 11 |
-
[`react-native-executorch-
|
| 12 |
not an OCR model on their own.
|
| 13 |
|
| 14 |
If you'd like to run these models in your own ExecuTorch runtime, refer to the
|
|
@@ -17,7 +17,9 @@ If you'd like to run these models in your own ExecuTorch runtime, refer to the
|
|
| 17 |
## Methods
|
| 18 |
|
| 19 |
The fused `.pte` exposes **four methods** (the `.pte` is pure tensor→tensor; the client
|
| 20 |
-
does normalization, `argmax`/`softmax`, grid-sampling and the decode loop)
|
|
|
|
|
|
|
| 21 |
|
| 22 |
| method | source model | input | output | purpose |
|
| 23 |
|---|---|---|---|---|
|
|
@@ -26,16 +28,18 @@ does normalization, `argmax`/`softmax`, grid-sampling and the decode loop):
|
|
| 26 |
| `table_encode` | [SLANeXt](https://huggingface.co/PaddlePaddle/SLANeXt_wired_safetensors) | `[1,3,488,488]` | `feat[1,256,96]` | encode a cropped table image (run **once**) |
|
| 27 |
| `table_decode_step` | SLANeXt decoder | `(feat[1,256,96], hidden[1,256], onehot[1,50])` | `(probs[1,50], hidden[1,256])` | one **autoregressive** structure-token step |
|
| 28 |
|
| 29 |
-
## Backends &
|
| 30 |
-
|
| 31 |
-
| backend | target | precision | size |
|
| 32 |
-
|---|---|---|---|
|
| 33 |
-
| `xnnpack` | CPU | **int8** | ~26 MB |
|
| 34 |
-
| `coreml` | Apple ANE | weight-only int8 | **11.9 MB** |
|
| 35 |
-
| `vulkan` | Android GPU | fp16, except `table_decode_step` → XNNPACK | 23.9 MB |
|
| 36 |
-
|
| 37 |
-
`table_decode_step` is always computed in fp32 (autoregressive stability)
|
| 38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
## Compatibility
|
| 41 |
|
|
|
|
| 8 |
[React Native ExecuTorch](https://www.npmjs.com/package/react-native-executorch) library,
|
| 9 |
fused into **one multi-method `.pte`** per backend for the **ExecuTorch** runtime
|
| 10 |
(XNNPACK, CoreML, Vulkan). These are document pre/post-processing companions to
|
| 11 |
+
[`react-native-executorch-pp-ocrv6`](https://huggingface.co/software-mansion/react-native-executorch-pp-ocrv6) —
|
| 12 |
not an OCR model on their own.
|
| 13 |
|
| 14 |
If you'd like to run these models in your own ExecuTorch runtime, refer to the
|
|
|
|
| 17 |
## Methods
|
| 18 |
|
| 19 |
The fused `.pte` exposes **four methods** (the `.pte` is pure tensor→tensor; the client
|
| 20 |
+
does normalization, `argmax`/`softmax`, grid-sampling and the decode loop). All methods are
|
| 21 |
+
**fixed-shape** — the exact input shapes below are also declared in `config.json`; there are
|
| 22 |
+
no shape-discovery companion methods on this model.
|
| 23 |
|
| 24 |
| method | source model | input | output | purpose |
|
| 25 |
|---|---|---|---|---|
|
|
|
|
| 28 |
| `table_encode` | [SLANeXt](https://huggingface.co/PaddlePaddle/SLANeXt_wired_safetensors) | `[1,3,488,488]` | `feat[1,256,96]` | encode a cropped table image (run **once**) |
|
| 29 |
| `table_decode_step` | SLANeXt decoder | `(feat[1,256,96], hidden[1,256], onehot[1,50])` | `(probs[1,50], hidden[1,256])` | one **autoregressive** structure-token step |
|
| 30 |
|
| 31 |
+
## Backends, precision & latency (warm)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
+
| backend | target | precision | size | orientation / table_encode / dewarp / decode_step |
|
| 34 |
+
|---|---|---|---|---|
|
| 35 |
+
| `xnnpack` | CPU | **dynamic int8** (qd8 — lossless; static int8 is lossy on the regressors) | ~28 MB | 2.0 / 30 / 209 / 0.21 ms (Galaxy S24) |
|
| 36 |
+
| `coreml` | Apple ANE | weight-only int8 | **11.9 MB** | 0.3 / 1.4 / 4.7 / 0.13 ms (Apple M-series ANE) |
|
| 37 |
+
| `vulkan` | Android GPU | fp16, except the table path → XNNPACK (mixed-delegate) | 23 MB | 6.0 / 17 / 66 / 0.21 ms (Galaxy S24) |
|
| 38 |
+
|
| 39 |
+
- The GPU wins on the heavy CNNs (dewarp 3×); the tiny `orientation` and the dispatch-bound
|
| 40 |
+
autoregressive `table_decode_step` are faster on CPU — hence the Vulkan build routes the
|
| 41 |
+
table path to XNNPACK.
|
| 42 |
+
- `table_decode_step` is always computed at full precision on CPU (autoregressive stability).
|
| 43 |
|
| 44 |
## Compatibility
|
| 45 |
|