File size: 14,919 Bytes
53a1eec
 
5c311e2
 
 
 
 
 
 
 
 
53a1eec
5c311e2
 
 
 
 
 
 
 
 
 
 
 
 
 
bf1d5ed
 
 
 
 
 
 
 
 
 
5c311e2
bf1d5ed
 
 
 
 
 
 
 
 
 
 
5c311e2
 
 
bf1d5ed
5c311e2
 
 
 
bf1d5ed
 
5c311e2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
---
license: apache-2.0
library_name: onnx
pipeline_tag: image-to-text
tags:
  - ocr
  - paddleocr
  - onnx
  - onnxruntime
  - text-detection
  - text-recognition
---

# ppu-paddle-ocr-models

This repository contains models necessarily use by [ppu-paddle-ocr](https://github.com/PT-Perkasa-Pilar-Utama/ppu-paddle-ocr) library.

>[!IMPORTANT]
> We've just added Paddle OCR's PP-OCRv6 model family

It consists of layout models, text detection models, and text recognition models.

The models are onnx sourced from https://www.paddleocr.ai/main/en/index.html.

`.ort` files are the same models pre-serialised in ONNX Runtime's native FlatBuffers format. They load 3-5x faster than the equivalent `.onnx` (session creation drops from ~24 ms to ~7 ms on M1) while producing byte-identical output. Load them with `session: { graphOptimizationLevel: "disabled" }` so ORT doesn't re-optimise the already-optimised graph.

## Where to fetch from

Fetch from the **Hugging Face mirror**. It serves models and dictionaries from one CDN-backed base, and unlike Git LFS it has no bandwidth budget that can run out and cut off downloads.

```
https://huggingface.co/snowfluke/ppu-paddle-ocr-models/resolve/main
```

Paths are identical on both hosts, so the base is the only part that changes:

```ts
const BASE = "https://huggingface.co/snowfluke/ppu-paddle-ocr-models/resolve/main";

const detection = `${BASE}/detection/ort/PP-OCRv6_tiny_det.ort`;
const recognition = `${BASE}/recognition/ort/PP-OCRv6_tiny_rec.ort`;
const dictionary = `${BASE}/recognition/ppocrv6_dict.txt`;
```

The GitHub copies stay available, because every published `ppu-paddle-ocr` version resolves them at runtime:

```ts
// Git LFS, subject to a bandwidth budget
export const MODEL_BASE_URL =
  "https://media.githubusercontent.com/media/PT-Perkasa-Pilar-Utama/ppu-paddle-ocr-models/main";

// plain files, not LFS
export const DICT_BASE_URL =
  "https://raw.githubusercontent.com/PT-Perkasa-Pilar-Utama/ppu-paddle-ocr-models/main";
```

This repository is the source of truth. The mirror is refreshed by the `Publish to Hugging Face` workflow, which uploads only what changed.

# File tree

```bash
.
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ convert
β”‚   β”œβ”€β”€ README.md
β”‚   β”œβ”€β”€ main.py
β”‚   β”œβ”€β”€ multi
β”‚   β”‚   └── japan_PP-OCRv3_mobile_rec_infer
β”‚   β”‚       β”œβ”€β”€ inference.json
β”‚   β”‚       β”œβ”€β”€ inference.pdiparams
β”‚   β”‚       └── inference.yml
β”‚   β”œβ”€β”€ pyproject.toml
β”‚   └── uv.lock
β”œβ”€β”€ correction
β”‚   β”œβ”€β”€ PP-LCNet_x0_25_textline_ori.onnx
β”‚   β”œβ”€β”€ PP-LCNet_x1_0_doc_ori.onnx
β”‚   β”œβ”€β”€ PP-LCNet_x1_0_textline_ori.onnx
β”‚   └── UVDoc.onnx
β”œβ”€β”€ detection
β”‚   β”œβ”€β”€ PP-OCRv4_mobile_det_infer.onnx
β”‚   β”œβ”€β”€ PP-OCRv4_server_det_infer.onnx
β”‚   β”œβ”€β”€ PP-OCRv5_mobile_det_infer.onnx
β”‚   β”œβ”€β”€ PP-OCRv5_mobile_det_infer.ort
β”‚   β”œβ”€β”€ PP-OCRv5_server_det_infer.onnx
β”‚   β”œβ”€β”€ PP-OCRv6_medium_det.onnx
β”‚   β”œβ”€β”€ PP-OCRv6_small_det.onnx
β”‚   β”œβ”€β”€ PP-OCRv6_tiny_det.onnx
β”‚   └── ort
β”‚       β”œβ”€β”€ PP-OCRv6_medium_det.ort
β”‚       β”œβ”€β”€ PP-OCRv6_small_det.ort
β”‚       └── PP-OCRv6_tiny_det.ort
β”œβ”€β”€ layout
β”‚   β”œβ”€β”€ PP-DocLayoutV2.onnx
β”‚   β”œβ”€β”€ PP-DocLayoutV2_labels.txt
β”‚   β”œβ”€β”€ PP-DocLayoutV3.onnx
β”‚   └── PP-DocLayoutV3_labels.txt
β”œβ”€β”€ recognition
β”‚   β”œβ”€β”€ PP-OCRv3_mobile_rec_infer.onnx
β”‚   β”œβ”€β”€ PP-OCRv4_mobile_rec_infer.onnx
β”‚   β”œβ”€β”€ PP-OCRv4_server_rec_doc_infer.onnx
β”‚   β”œβ”€β”€ PP-OCRv4_server_rec_infer.onnx
β”‚   β”œβ”€β”€ PP-OCRv5_mobile_rec_infer.onnx
β”‚   β”œβ”€β”€ PP-OCRv5_server_rec_infer.onnx
β”‚   β”œβ”€β”€ PP-OCRv6_medium_rec.onnx
β”‚   β”œβ”€β”€ PP-OCRv6_small_rec.onnx
β”‚   β”œβ”€β”€ PP-OCRv6_tiny_rec.onnx
β”‚   β”œβ”€β”€ multi
β”‚   β”‚   β”œβ”€β”€ arabic
β”‚   β”‚   β”‚   └── v5
β”‚   β”‚   β”‚       β”œβ”€β”€ arabic_PP-OCRv5_mobile_rec_infer.onnx
β”‚   β”‚   β”‚       └── ppocrv5_arabic_dict.txt
β”‚   β”‚   β”œβ”€β”€ cyrillic
β”‚   β”‚   β”‚   └── v5
β”‚   β”‚   β”‚       β”œβ”€β”€ cyrillic_PP-OCRv5_mobile_rec_infer.onnx
β”‚   β”‚   β”‚       └── ppocrv5_cyrillic_dict.txt
β”‚   β”‚   β”œβ”€β”€ devanagari
β”‚   β”‚   β”‚   └── v5
β”‚   β”‚   β”‚       β”œβ”€β”€ devanagari_PP-OCRv5_mobile_rec_infer.onnx
β”‚   β”‚   β”‚       └── ppocrv5_devanagari_dict.txt
β”‚   β”‚   β”œβ”€β”€ el
β”‚   β”‚   β”‚   └── v5
β”‚   β”‚   β”‚       β”œβ”€β”€ el_PP-OCRv5_mobile_rec_infer.onnx
β”‚   β”‚   β”‚       └── ppocrv5_el_dict.txt
β”‚   β”‚   β”œβ”€β”€ en
β”‚   β”‚   β”‚   β”œβ”€β”€ v4
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ en_PP-OCRv4_mobile_rec_infer.onnx
β”‚   β”‚   β”‚   β”‚   └── en_dict.txt
β”‚   β”‚   β”‚   └── v5
β”‚   β”‚   β”‚       β”œβ”€β”€ en_PP-OCRv5_mobile_rec_infer.onnx
β”‚   β”‚   β”‚       β”œβ”€β”€ en_PP-OCRv5_mobile_rec_infer.ort
β”‚   β”‚   β”‚       β”œβ”€β”€ en_PP-OCRv5_mobile_rec_infer_int8.onnx
β”‚   β”‚   β”‚       β”œβ”€β”€ en_PP-OCRv5_mobile_rec_infer_int8.ort
β”‚   β”‚   β”‚       └── ppocrv5_en_dict.txt
β”‚   β”‚   β”œβ”€β”€ eslav
β”‚   β”‚   β”‚   └── v5
β”‚   β”‚   β”‚       β”œβ”€β”€ eslav_PP-OCRv5_mobile_rec_infer.onnx
β”‚   β”‚   β”‚       └── ppocrv5_eslav_dict.txt
β”‚   β”‚   β”œβ”€β”€ japan
β”‚   β”‚   β”‚   └── v3
β”‚   β”‚   β”‚       β”œβ”€β”€ japan_PP-OCRv3_mobile_rec_infer.onnx
β”‚   β”‚   β”‚       └── japan_dict.txt
β”‚   β”‚   β”œβ”€β”€ korean
β”‚   β”‚   β”‚   └── v5
β”‚   β”‚   β”‚       β”œβ”€β”€ korean_PP-OCRv5_mobile_rec_infer.onnx
β”‚   β”‚   β”‚       └── ppocrv5_korean_dict.txt
β”‚   β”‚   β”œβ”€β”€ latin
β”‚   β”‚   β”‚   └── v5
β”‚   β”‚   β”‚       β”œβ”€β”€ latin_PP-OCRv5_mobile_rec_infer.onnx
β”‚   β”‚   β”‚       └── ppocrv5_latin_dict.txt
β”‚   β”‚   β”œβ”€β”€ ta
β”‚   β”‚   β”‚   └── v5
β”‚   β”‚   β”‚       β”œβ”€β”€ ppocrv5_ta_dict.txt
β”‚   β”‚   β”‚       └── ta_PP-OCRv5_mobile_rec_infer.onnx
β”‚   β”‚   β”œβ”€β”€ te
β”‚   β”‚   β”‚   └── v5
β”‚   β”‚   β”‚       β”œβ”€β”€ ppocrv5_te_dict.txt
β”‚   β”‚   β”‚       └── te_PP-OCRv5_mobile_rec_infer.onnx
β”‚   β”‚   └── th
β”‚   β”‚       └── v5
β”‚   β”‚           β”œβ”€β”€ ppocrv5_th_dict.txt
β”‚   β”‚           └── th_PP-OCRv5_mobile_rec_infer.onnx
β”‚   β”œβ”€β”€ ort
β”‚   β”‚   β”œβ”€β”€ PP-OCRv6_medium_rec.ort
β”‚   β”‚   β”œβ”€β”€ PP-OCRv6_small_rec.ort
β”‚   β”‚   └── PP-OCRv6_tiny_rec.ort
β”‚   β”œβ”€β”€ ppocrv3_dict.txt
β”‚   β”œβ”€β”€ ppocrv4_dict.txt
β”‚   β”œβ”€β”€ ppocrv4_doc_dict.txt
β”‚   β”œβ”€β”€ ppocrv5_dict.txt
β”‚   β”œβ”€β”€ ppocrv6_dict.txt
β”‚   └── ppocrv6_tiny_dict.txt
└── table
    β”œβ”€β”€ PP-LCNet_x1_0_table_cls.onnx
    β”œβ”€β”€ RT-DETR-L_wired_table_cell_det.onnx
    β”œβ”€β”€ RT-DETR-L_wireless_table_cell_det.onnx
    └── SLANet_plus.onnx
```

# OCR Models and Their Supported Languages

| Model                          | Supported Languages                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| korean_PP-OCRv5_mobile_rec     | Korean, English                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| latin_PP-OCRv5_mobile_rec      | French, German, Afrikaans, Italian, Spanish, Bosnian, Portuguese, Czech, Welsh, Danish, Estonian, Irish, Croatian, Uzbek, Hungarian, Serbian (Latin), Indonesian, Occitan, Icelandic, Lithuanian, Maori, Malay, Dutch, Norwegian, Polish, Slovak, Slovenian, Albanian, Swedish, Swahili, Tagalog, Turkish, Latin, Azerbaijani, Kurdish, Latvian, Maltese, Pali, Romanian, Vietnamese, Finnish, Basque, Galician, Luxembourgish, Romansh, Catalan, Quechua |
| eslav_PP-OCRv5_mobile_rec      | Russian, Belarusian, Ukrainian, English                                                                                                                                                                                                                                                                                                                                                                                                                   |
| th_PP-OCRv5_mobile_rec         | Thai, English                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| el_PP-OCRv5_mobile_rec         | Greek, English                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| en_PP-OCRv5_mobile_rec         | English                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| cyrillic_PP-OCRv5_mobile_rec   | Russian, Belarusian, Ukrainian, Serbian (Cyrillic), Bulgarian, Mongolian, Abkhazian, Adyghe, Kabardian, Avar, Dargin, Ingush, Chechen, Lak, Lezgin, Tabasaran, Kazakh, Kyrgyz, Tajik, Macedonian, Tatar, Chuvash, Bashkir, Malian, Moldovan, Udmurt, Komi, Ossetian, Buryat, Kalmyk, Tuvan, Sakha, Karakalpak, English                                                                                                                                    |
| arabic_PP-OCRv5_mobile_rec     | Arabic, Persian, Uyghur, Urdu, Pashto, Kurdish, Sindhi, Balochi, English                                                                                                                                                                                                                                                                                                                                                                                  |
| devanagari_PP-OCRv5_mobile_rec | Hindi, Marathi, Nepali, Bihari, Maithili, Angika, Bhojpuri, Magahi, Santali, Newari, Konkani, Sanskrit, Haryanvi, English                                                                                                                                                                                                                                                                                                                                 |
| ta_PP-OCRv5_mobile_rec         | Tamil, English                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| te_PP-OCRv5_mobile_rec         | Telugu, English                                                                                                                                                                                                                                                                                                                                                                                                                                           |

# Layout models

Model use for document layout analysis includes 20 common categories: document title, paragraph title, text, page number, abstract, table, references, footnotes, header, footer, algorithm, formula, formula number, image, table, seal, figure_table title, chart, and sidebar text and lists of references

- PP-DocLayoutV2
- PP-DocLayoutV3

We only converted the layout analysis model, which by default already implemented layout detection. The difference is that layout analysis model doing extra for analyze the reading order. If you want an individual model that just do the layout detection, go check out: https://paddlepaddle.github.io/PaddleX/latest/en/module_usage/tutorials/ocr_modules/layout_detection.html#ii-supported-model-list

# Correction models

## Document Image Orientation Classification

The document image orientation classification module is aim to distinguish the orientation of document images and correct them through post-processing.

- PP-LCNet_x1_0_doc_ori

## Text Image Unwarping

Perform geometric transformations on images in order to correct issues such as document distortion, tilt, perspective deformation, etc., enabling more accurate recognition by subsequent text recognition modules.

- UVDoc

## Text Line Orientation Classification

The text line orientation classification module primarily distinguishes the orientation of text lines and corrects them using post-processing.

- PP-LCNet_x0_25_textline_ori
- PP-LCNet_x1_0_textline_ori

# Table models

## Table Structure Recognition

- SLANet_plus

## Table Classification

- PP-LCNet_x1_0_table_cls

## Table Cell Detection

- RT-DETR-L_wired_table_cell_det
- RT-DETR-L_wireless_table_cell_det