File size: 2,943 Bytes
b80941f
 
 
ff65f98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: mit
---
# Introduction

This repository hosts the [EasyOCR](https://github.com/JaidedAI/EasyOCR) models — the
[CRAFT detector](https://github.com/clovaai/CRAFT-pytorch) and the [CRNN recognizer](https://www.jaided.ai/easyocr/modelhub/) — for the
[React Native ExecuTorch](https://www.npmjs.com/package/react-native-executorch) library,
exported to `.pte` for the **ExecuTorch** runtime (XNNPACK, CoreML and Vulkan backends).

If you'd like to run these models in your own ExecuTorch runtime, refer to the
[official documentation](https://pytorch.org/executorch/stable/index.html) for setup instructions.

Each language ships as **one fused `.pte`** (CRAFT *detect* + CRNN *recognize* in a single
file) per backend, using **static bucketed methods** — no dynamic-shape footguns. The `.pte`
is a pure tensor→tensor function; all pre/post-processing (resize, normalize, box extraction,
crop, CTC decode) is the client's job and is driven by `config.json`.

## Languages

| code | charset size | code | charset size |
|---|---|---|---|
| english | 96 | korean | 1008 |
| latin | 351 | telugu | 165 |
| japanese | 2214 | kannada | 167 |
| zh_sim | 6718 | cyrillic | 207 |

All languages share the same CRAFT detector and CRNN architecture — they differ **only** in
the recognizer charset. The detector half of each fused PTE is identical across languages.

## Backends

| backend | target | precision |
|---|---|---|
| `xnnpack` | CPU (Android/iOS) | int8 (CRAFT + CRNN) |
| `coreml` | Apple ANE | weight-only int8 |
| `vulkan` | Android GPU | CRAFT int8 (GPU) + CRNN int8 (XNNPACK, mixed-delegate) |


## Files

```
config.json                                   # shared base config (schema v1)
charsets/easyocr_<lang>.charset.txt           # per-language CTC charset (JSON array)
<lang>/<backend>/easyocr_<lang>_<backend>_bucketed.pte
```

- `config.json` is **shared** across all languages; it carries
  `charsetUrlPattern: "easyocr_<lang>.charset.txt"` so the client resolves the charset by
  language. Charset index `i` maps to logit `i + 1` (logit `0` is the CTC blank).

## Buckets

Static per-size methods (`is_bucketed()` reports `[detect sides ; recognize widths]`):

- **detect** (square sides): `800, 1280``detect_800`, `detect_1280` (+ a `1280×320` portrait method)
- **recognize** (widths, height 64): `64, 128, 256, 512``recognize_64 … recognize_512`
`detect` runs once per image; `recognize` runs once per text line.

## Compatibility

If you intend to use these models outside of React Native ExecuTorch, make sure your runtime is
compatible with the **ExecuTorch** version used to export the `.pte` files. For more details, see
the compatibility note in the
[ExecuTorch GitHub repository](https://github.com/pytorch/executorch/blob/main/runtime/COMPATIBILITY.md).
If you work with React Native ExecuTorch, the library constants guarantee compatibility with the
runtime used behind the scenes.