Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,49 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
---
|
| 4 |
+
|
| 5 |
+
# Introduction
|
| 6 |
+
|
| 7 |
+
This repository hosts [PaddleOCR PP-OCRv6](https://github.com/PaddlePaddle/PaddleOCR) (the
|
| 8 |
+
[detector](https://huggingface.co/PaddlePaddle/PP-OCRv6_small_det_safetensors) +
|
| 9 |
+
[recognizer](https://huggingface.co/PaddlePaddle/PP-OCRv6_small_rec_safetensors)) for the
|
| 10 |
+
[React Native ExecuTorch](https://www.npmjs.com/package/react-native-executorch) library,
|
| 11 |
+
exported to `.pte` for the **ExecuTorch** runtime (XNNPACK, CoreML and Vulkan backends).
|
| 12 |
+
|
| 13 |
+
If you'd like to run these models in your own ExecuTorch runtime, refer to the
|
| 14 |
+
[official documentation](https://pytorch.org/executorch/stable/index.html) for setup instructions.
|
| 15 |
+
|
| 16 |
+
PP-OCRv6 is the **primary** OCR pipeline — smallest and fastest. It ships as **one fused `.pte`** per backend, using **static bucketed
|
| 17 |
+
methods**. The `.pte` is a pure tensor→tensor function; all pre/post-processing (resize,
|
| 18 |
+
normalize, DBNet box decode, perspective crop, CTC decode) is the client's job and is driven by
|
| 19 |
+
`config.json`. One model covers **all languages** (18 709-entry multilingual charset).
|
| 20 |
+
|
| 21 |
+
## Backends
|
| 22 |
+
|
| 23 |
+
| backend | target | detect | recognize |
|
| 24 |
+
|---|---|---|---|
|
| 25 |
+
| `xnnpack` | CPU | int8 (DBNet) | fp32 (SVTR) |
|
| 26 |
+
| `coreml` | Apple ANE | weight-only int8 | weight-only int8 |
|
| 27 |
+
| `vulkan` | Android GPU | fp16 (GPU) | fp32 on **XNNPACK** (mixed-delegate) |
|
| 28 |
+
|
| 29 |
+
> **Vulkan is mixed-delegate**: DBNet detects on the GPU, but the SVTR recognizer runs on the
|
| 30 |
+
> CPU (XNNPACK). int8 SVTR is lossy on the 18 709-token vocab — so the recognizer stays fp32 on CPU for correctness.
|
| 31 |
+
|
| 32 |
+
## Buckets
|
| 33 |
+
|
| 34 |
+
`is_bucketed()` reports `[detect sides ; recognize widths]`:
|
| 35 |
+
|
| 36 |
+
- **detect** (square sides ÷32): `640, 960, 1280` → `detect_640 / detect_960 / detect_1280`
|
| 37 |
+
(+ a `1280×640` portrait method `detect_640x1280`)
|
| 38 |
+
- **recognize** (widths ÷8, height 48): `160, 320, 480, 640` → `recognize_160 … recognize_640`
|
| 39 |
+
|
| 40 |
+
Detector input is RGB, normalized `(x/255 − 0.5)/0.5`.
|
| 41 |
+
|
| 42 |
+
## Compatibility
|
| 43 |
+
|
| 44 |
+
If you intend to use these models outside of React Native ExecuTorch, make sure your runtime is
|
| 45 |
+
compatible with the **ExecuTorch** version used to export the `.pte` files. For more details, see
|
| 46 |
+
the compatibility note in the
|
| 47 |
+
[ExecuTorch GitHub repository](https://github.com/pytorch/executorch/blob/main/runtime/COMPATIBILITY.md).
|
| 48 |
+
If you work with React Native ExecuTorch, the library constants guarantee compatibility with the
|
| 49 |
+
runtime used behind the scenes.
|