Image-to-Text
ExecuTorch
File size: 2,432 Bytes
697af99
 
4e5f125
 
697af99
8b0eb8b
397738f
8b0eb8b
397738f
 
 
8b0eb8b
397738f
8b0eb8b
397738f
 
 
8b0eb8b
397738f
72f021c
397738f
 
 
 
 
 
cfdeaac
397738f
cfdeaac
397738f
 
 
 
 
 
 
 
 
 
 
cfdeaac
397738f
8b0eb8b
397738f
 
 
8b0eb8b
397738f
 
91bd390
8b0eb8b
397738f
 
 
8b0eb8b
cfdeaac
8b0eb8b
cfdeaac
 
 
 
 
8b0eb8b
397738f
72f021c
397738f
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
license: apache-2.0
pipeline_tag: image-to-text
library_name: executorch
---

# pp-ocrv6

This repository hosts the **pp-ocrv6** models exported for the
[React Native ExecuTorch](https://www.npmjs.com/package/react-native-executorch)
library as ExecuTorch `.pte` programs, ready to run on device.

Upstream models:

- [PaddleOCR PP-OCRv6](https://github.com/PaddlePaddle/PaddleOCR)
- [detector](https://huggingface.co/PaddlePaddle/PP-OCRv6_small_det_safetensors)
- [recognizer](https://huggingface.co/PaddlePaddle/PP-OCRv6_small_rec_safetensors)

## Variants

| Path | Backend | Precision |
| --- | --- | --- |
| `coreml/pp_ocrv6_coreml_int8.pte` | coreml | int8 |
| `vulkan/pp_ocrv6_vulkan_fp16.pte` | vulkan | fp16 |
| `xnnpack/pp_ocrv6_xnnpack_fp32.pte` | xnnpack | fp32 |
| `xnnpack/pp_ocrv6_xnnpack_int8.pte` | xnnpack | int8 |

## Repository structure

```
charset.json                       128 kB
config.json                        30 B
coreml/config.json                 1.3 kB
coreml/pp_ocrv6_coreml_int8.pte    7.9 MB
vulkan/config.json                 1.3 kB
vulkan/pp_ocrv6_vulkan_fp16.pte    25.0 MB
xnnpack/config.json                2.3 kB
xnnpack/pp_ocrv6_xnnpack_fp32.pte  29.6 MB
xnnpack/pp_ocrv6_xnnpack_int8.pte  22.8 MB
```

## Compatibility

These files are published for the **ExecuTorch v1.4.1** runtime. ExecuTorch
gives no forward compatibility guarantee, so an older runtime may fail to load
them.

To use them in React Native ExecuTorch, pass the model constant shipped in the
library's model registry to the corresponding task pipeline. See the
[documentation](https://docs.swmansion.com/react-native-executorch/docs/fundamentals/downloading-models).

To load these files in your own ExecuTorch runtime, read the
[compatibility note](https://github.com/pytorch/executorch/blob/main/runtime/COMPATIBILITY.md)
first.

## CoreML notes (iOS)

- The CoreML `.pte` is a **multifunction** Core ML model (`detect` + `recognize` share one
  precompiled `.mlmodelc`). Requires **iOS 18+** and an ExecuTorch runtime ≥ 1.3 (multifunction
  loading via `functionName`).
- First-ever load on a device triggers a one-time per-shape ANE specialization (OS-cached
  afterwards) — warm each model once after install.

## Model details

The recognizer's output is a probability distribution over the charset with
softmax already baked in. Index `0` is the CTC blank, so `charset[i]`
corresponds to logit `i + 1`.