--- comments: true --- # Text Recognition Module Tutorial ## 1. Overview The text recognition module is the core component of an OCR (Optical Character Recognition) system, responsible for extracting text information from text regions within images. The performance of this module directly impacts the accuracy and efficiency of the entire OCR system. Typically, the text recognition module takes the bounding boxes of text regions output by the text detection module as input and then converts the text in the images into editable and searchable electronic text through complex image processing and deep learning algorithms. The accuracy of the text recognition results is crucial for subsequent applications such as information extraction and data mining. ## 2. List of Supported Models
Model | Model Download Links | Recognition Avg Accuracy(%) | GPU Inference Time (ms) [Normal Mode / High-Performance Mode] |
CPU Inference Time (ms) [Normal Mode / High-Performance Mode] |
Model Storage Size (M) | Introduction |
---|---|---|---|---|---|---|
PP-OCRv5_server_rec | Inference Model/Pretrained Model | 86.38 | 8.45/2.36 | 122.69/122.69 | 81 M | PP-OCRv5_rec is a next-generation text recognition model. It aims to efficiently and accurately support the recognition of four major languages—Simplified Chinese, Traditional Chinese, English, and Japanese—as well as complex text scenarios such as handwriting, vertical text, pinyin, and rare characters using a single model. While maintaining recognition performance, it balances inference speed and model robustness, providing efficient and accurate technical support for document understanding in various scenarios. |
PP-OCRv5_mobile_rec | Inference Model/Pretrained Model | 81.29 | 1.46/5.43 | 5.32/91.79 | 16 M | |
PP-OCRv4_server_rec_doc | Inference Model/Pretrained Model | 86.58 | 6.65 / 2.38 | 32.92 / 32.92 | 91 M | PP-OCRv4_server_rec_doc is trained on a mixed dataset of more Chinese document data and PP-OCR training data, building upon PP-OCRv4_server_rec. It enhances the recognition capabilities for some Traditional Chinese characters, Japanese characters, and special symbols, supporting over 15,000 characters. In addition to improving document-related text recognition, it also enhances general text recognition capabilities. |
PP-OCRv4_mobile_rec | Inference Model/Pretrained Model | 83.28 | 4.82 / 1.20 | 16.74 / 4.64 | 11 M | A lightweight recognition model of PP-OCRv4 with high inference efficiency, suitable for deployment on various hardware devices, including edge devices. |
PP-OCRv4_server_rec | Inference Model/Pretrained Model | 85.19 | 6.58 / 2.43 | 33.17 / 33.17 | 87 M | The server-side model of PP-OCRv4, offering high inference accuracy and deployable on various servers. |
en_PP-OCRv4_mobile_rec | Inference Model/Pretrained Model | 70.39 | 4.81 / 0.75 | 16.10 / 5.31 | 7.3 M | An ultra-lightweight English recognition model trained based on the PP-OCRv4 recognition model, supporting English and numeric character recognition. |
Model | Model Download Links | Avg Accuracy for Chinese Recognition (%) | Avg Accuracy for English Recognition (%) | Avg Accuracy for Traditional Chinese Recognition (%) | Avg Accuracy for Japanese Recognition (%) | GPU Inference Time (ms) [Normal Mode / High-Performance Mode] |
CPU Inference Time (ms) [Normal Mode / High-Performance Mode] |
Model Storage Size (M) | Introduction |
---|---|---|---|---|---|---|---|---|---|
PP-OCRv5_server_rec | Inference Model/Pretrained Model | 86.38 | 64.70 | 93.29 | 60.35 | 8.45/2.36 | 122.69/122.69 | 81 M | PP-OCRv5_rec is a next-generation text recognition model. It aims to efficiently and accurately support the recognition of four major languages—Simplified Chinese, Traditional Chinese, English, and Japanese—as well as complex text scenarios such as handwriting, vertical text, pinyin, and rare characters using a single model. While maintaining recognition performance, it balances inference speed and model robustness, providing efficient and accurate technical support for document understanding in various scenarios. |
PP-OCRv5_mobile_rec | Inference Model/Pretrained Model | 81.29 | 66.00 | 83.55 | 54.65 | 1.46/5.43 | 5.32/91.79 | 16 M |
Model | Model Download Links | Avg Accuracy (%) | GPU Inference Time (ms) [Normal Mode / High-Performance Mode] |
CPU Inference Time (ms) [Normal Mode / High-Performance Mode] |
Model Storage Size (M) | Introduction |
---|---|---|---|---|---|---|
PP-OCRv4_server_rec_doc | Inference Model/Pretrained Model | 86.58 | 6.65 / 2.38 | 32.92 / 32.92 | 91 M | PP-OCRv4_server_rec_doc is trained on a mixed dataset of more Chinese document data and PP-OCR training data, building upon PP-OCRv4_server_rec. It enhances the recognition capabilities for some Traditional Chinese characters, Japanese characters, and special symbols, supporting over 15,000 characters. In addition to improving document-related text recognition, it also enhances general text recognition capabilities. |
PP-OCRv4_mobile_rec | Inference Model/Pretrained Model | 83.28 | 4.82 / 1.20 | 16.74 / 4.64 | 11 M | A lightweight recognition model of PP-OCRv4 with high inference efficiency, suitable for deployment on various hardware devices, including edge devices. |
PP-OCRv4_server_rec | Inference Model/Pretrained Model | 85.19 | 6.58 / 2.43 | 33.17 / 33.17 | 87 M | The server-side model of PP-OCRv4, offering high inference accuracy and deployable on various servers. |
PP-OCRv3_mobile_rec | Inference Model/Pretrained Model | 75.43 | 5.87 / 1.19 | 9.07 / 4.28 | 11 M | A lightweight recognition model of PP-OCRv3 with high inference efficiency, suitable for deployment on various hardware devices, including edge devices. |
Model | Model Download Links | Avg Accuracy (%) | GPU Inference Time (ms) [Normal Mode / High-Performance Mode] |
CPU Inference Time (ms) [Normal Mode / High-Performance Mode] |
Model Storage Size (M) | Introduction |
---|---|---|---|---|---|---|
ch_SVTRv2_rec | Inference Model/Pretrained Model | 68.81 | 8.08 / 2.74 | 50.17 / 42.50 | 73.9 M | SVTRv2 is a server-side text recognition model developed by the OpenOCR team of the Vision and Learning Lab (FVL) at Fudan University. It won the first prize in the PaddleOCR Algorithm Model Challenge - Task 1: OCR End-to-End Recognition Task, with a 6% improvement in end-to-end recognition accuracy on Leaderboard A compared to PP-OCRv4. |
Model | Model Download Links | Avg Accuracy (%) | GPU Inference Time (ms) [Normal Mode / High-Performance Mode] |
CPU Inference Time (ms) [Normal Mode / High-Performance Mode] |
Model Storage Size (M) | Introduction |
---|---|---|---|---|---|---|
ch_RepSVTR_rec | Inference Model/Pretrained Model | 65.07 | 5.93 / 1.62 | 20.73 / 7.32 | 22.1 M | RepSVTR is a mobile-side text recognition model based on SVTRv2. It won the first prize in the PaddleOCR Algorithm Model Challenge - Task 1: OCR End-to-End Recognition Task, with a 2.5% improvement in end-to-end recognition accuracy on Leaderboard B compared to PP-OCRv4, while maintaining similar inference speed. |
Model | Model Download Links | Avg Accuracy (%) | GPU Inference Time (ms) [Normal Mode / High-Performance Mode] |
CPU Inference Time (ms) [Normal Mode / High-Performance Mode] |
Model Storage Size (M) | Introduction |
---|---|---|---|---|---|---|
en_PP-OCRv4_mobile_rec | Inference Model/Pretrained Model | 70.39 | 4.81 / 0.75 | 16.10 / 5.31 | 6.8 M | An ultra-lightweight English recognition model trained based on the PP-OCRv4 recognition model, supporting English and numeric character recognition. |
en_PP-OCRv3_mobile_rec | Inference Model/Pretrained Model | 70.69 | 5.44 / 0.75 | 8.65 / 5.57 | 7.8 M | An ultra-lightweight English recognition model trained based on the PP-OCRv3 recognition model, supporting English and numeric character recognition. |
Model | Model Download Links | Avg Accuracy (%) | GPU Inference Time (ms) [Normal Mode / High-Performance Mode] |
CPU Inference Time (ms) [Normal Mode / High-Performance Mode] |
Model Storage Size (M) | Introduction |
---|---|---|---|---|---|---|
korean_PP-OCRv3_mobile_rec | Inference Model/Pretrained Model | 60.21 | 5.40 / 0.97 | 9.11 / 4.05 | 8.6 M | An ultra-lightweight Korean recognition model trained based on the PP-OCRv3 recognition model, supporting Korean and numeric character recognition. |
japan_PP-OCRv3_mobile_rec | Inference Model/Pretrained Model | 45.69 | 5.70 / 1.02 | 8.48 / 4.07 | 8.8 M | An ultra-lightweight Japanese recognition model trained based on the PP-OCRv3 recognition model, supporting Japanese and numeric character recognition. |
chinese_cht_PP-OCRv3_mobile_rec | Inference Model/Pretrained Model | 82.06 | 5.90 / 1.28 | 9.28 / 4.34 | 9.7 M | An ultra-lightweight Traditional Chinese recognition model trained based on the PP-OCRv3 recognition model, supporting Traditional Chinese and numeric character recognition. |
te_PP-OCRv3_mobile_rec | Inference Model/Pretrained Model | 95.88 | 5.42 / 0.82 | 8.10 / 6.91 | 7.8 M | An ultra-lightweight Telugu recognition model trained based on the PP-OCRv3 recognition model, supporting Telugu and numeric character recognition. |
ka_PP-OCRv3_mobile_rec | Inference Model/Pretrained Model | 96.96 | 5.25 / 0.79 | 9.09 / 3.86 | 8.0 M | An ultra-lightweight Kannada recognition model trained based on the PP-OCRv3 recognition model, supporting Kannada and numeric character recognition. |
ta_PP-OCRv3_mobile_rec | Inference Model/Pretrained Model | 76.83 | 5.23 / 0.75 | 10.13 / 4.30 | 8.0 M | An ultra-lightweight Tamil recognition model trained based on the PP-OCRv3 recognition model, supporting Tamil and numeric character recognition. |
latin_PP-OCRv3_mobile_rec | Inference Model/Pretrained Model | 76.93 | 5.20 / 0.79 | 8.83 / 7.15 | 7.8 M | An ultra-lightweight Latin recognition model trained based on the PP-OCRv3 recognition model, supporting Latin and numeric character recognition. |
arabic_PP-OCRv3_mobile_rec | Inference Model/Pretrained Model | 73.55 | 5.35 / 0.79 | 8.80 / 4.56 | 7.8 M | An ultra-lightweight Arabic alphabet recognition model trained based on the PP-OCRv3 recognition model, supporting Arabic alphabet and numeric character recognition. |
cyrillic_PP-OCRv3_mobile_rec | Inference Model/Pretrained Model | 94.28 | 5.23 / 0.76 | 8.89 / 3.88 | 7.9 M | An ultra-lightweight Cyrillic alphabet recognition model trained based on the PP-OCRv3 recognition model, supporting Cyrillic alphabet and numeric character recognition. |
devanagari_PP-OCRv3_mobile_rec | Inference Model/Pretrained Model | 96.44 | 5.22 / 0.79 | 8.56 / 4.06 | 7.9 M | An ultra-lightweight Devanagari alphabet recognition model trained based on the PP-OCRv3 recognition model, supporting Devanagari alphabet and numeric character recognition. |
Mode | GPU Configuration | CPU Configuration | Acceleration Technology Combination |
---|---|---|---|
Normal Mode | FP32 Precision / No TRT Acceleration | FP32 Precision / 8 Threads | PaddleInference |
High-Performance Mode | Optimal combination of precision type and acceleration strategy | FP32 Precision / 8 Threads | Selection of the optimal backend (Paddle/OpenVINO/TRT, etc.) |
Parameter | Description | Type | Options | Default Value |
---|---|---|---|---|
model_name |
Model name | str |
All model names supported by PaddleX | None |
model_dir |
Model storage path | str |
None | None |
device |
Model inference device | str |
Supports specifying specific GPU card numbers, such as "gpu:0", specific card numbers for other hardware, such as "npu:0", and "cpu" for CPU. | gpu:0 |
use_hpip |
Whether to enable the high-performance inference plugin | bool |
None | False |
hpi_config |
High-performance inference configuration | dict | None |
None | None |
Parameter | Description | Type | Options | Default Value |
---|---|---|---|---|
input |
Data to be predicted, supporting multiple input types | Python Var /str /list |
|
None |
batch_size |
Batch size | int |
Any integer | 1 |
Method | Description | Parameter | Type | Description | Default Value |
---|---|---|---|---|---|
print() |
Print the result to the terminal | format_json |
bool |
Whether to format the output content using JSON indentation |
True |
indent |
int |
Specifies the indentation level to beautify the output JSON data, making it more readable. Only effective when format_json is True . |
4 | ||
ensure_ascii |
bool |
Controls whether to escape non-ASCII characters as Unicode . When set to True , all non-ASCII characters will be escaped; False retains the original characters. Only effective when format_json is True . |
False |
||
save_to_json() |
Save the result as a file in json format |
save_path |
str |
The file path to save the result. When it is a directory, the saved file name is consistent with the naming of the input file type. | None |
indent |
int |
Specifies the indentation level to beautify the output JSON data, making it more readable. Only effective when format_json is True . |
4 | ||
ensure_ascii |
bool |
Controls whether to escape non-ASCII characters as Unicode . When set to True , all non-ASCII characters will be escaped; False retains the original characters. Only effective when format_json is True . |
False |
||
save_to_img() |
Save the result as a file in image format | save_path |
str |
The file path to save the result. When it is a directory, the saved file name is consistent with the naming of the input file type. | None |
Attribute | Description |
---|---|
json |
Obtain the prediction result in json format |
img |
Obtain the visualized image in dict format |