RapidOCR
简体中文 | English
Contents
- RapidOCR
- Introduction
- Recently updates(more)
- FAQ
- SDK compilation status
- Online demo
- Directory structure
- Current Progress
- Model related
- [Download models( Google Drive|Baidu NetDisk )](#download-models-google-drivebaidu-netdisk-)
- Model to onnx
- Compared
- PaddleOCR-FAQ
- Original initiator and start-up author
- Acknowledgements
- Authorization
- Contact us
- Demo
Introduction
-
Completely open source, free and support offline deployment of multi-platform and multi-language OCR SDK
-
Chinese Advertising: Welcome to join our QQ group to download the model and test program, QQ group number: 887298230
-
Cause: Baidu paddlepaddle engineering is not very good, in order to facilitate everyone to perform OCR reasoning on various terminals, we convert it to onnx format, use ``python/c++/java/swift/c#'' to change It is ported to various platforms.
-
Name Source: Light, fast, economical and smart. OCR technology based on deep learning technology focuses on artificial intelligence advantages and small models, with speed as the mission and effect as the leading role.
-
Based on Baidu's open source PaddleOCR model and training, anyone can use this inference library, or use Baidu's paddlepaddle framework for model optimization according to their own needs.
Recently updates(more)
😁2022-07-05 update:
- Add the ability to handle single line text, for single line text, you can set your own threshold, but the detection module, direct recognition can be. For details, see README
- Optimize some code logic of python, more elegant and concise.
🏝2022-06-30 update:
- In the python inference section, add a configuration option for whether to use GPU inference, which can be used with one click if the
onnxruntime-gpuversion is correctly installed (Fix issue#30) - The specific GPU-based reasoning will need to wait for me to sort it out and update it later.
- For details, see: [onnxruntime-gpu version reasoning configuration](./python/README.md#onnxruntime-gpu version reasoning configuration)
📌2022-06-25 update:
- Reorganize some of the python inference code, put all the common adjustment parameters into the yaml file, easy to adjust, easier to use, see: README
- The old inference code is located in the branch: old_python_infer
🍿2022-05-15 update
- Add the ONNX model converted from the PaddleOCR v3 rec model, just go to the network disk to download and replace it. (Baidu Netdisk | Google Drive)
- Added a comparison table of the effects of each version of the text recognition model. For details, click [Comparison of the effects of various versions of ONNX models] (#Comparison of the effects of various versions of onnx models). The text recognition model of v3 is not as good as the previous one in terms of the indicators on the test set constructed by itself.
😀2022-05-12 upadte
- Add the ONNX model converted from the PaddleOCR v3 det model, download it directly from the network disk, and replace it. (Baidu Netdisk | Google Drive)
- Added a comparison table of text detection model effects of various versions. For details, click [Comparison of the effects of various versions of ONNX models] (#Comparison of the effects of various versions of onnx models). The text detection model of v3 is better than the previous v2 in terms of the indicators on the test set constructed by itself, and it is recommended to use it.
FAQ
SDK compilation status
Since ubuntu users are all commercial users and have the ability to compile, pre-compiled packages are not provided for the time being, and they can be compiled by themselves.
| Platform | Compilation Status | Offer Status |
|---|---|---|
| Windows x86/x64 | Download Link | |
| Linux x64 | Not available yet, compile by yourself |
Online demo
- Web demo
- The model combination used in the demo is:
ch_PP-OCRv3_det + ch_ppocr_mobile_v2.0_cls + ch_ppocr_mobile_v2.0_rec - Environment:
4 Core AMD EPYC 7K62 48-Core Processor - Gif Demo:
Directory structure
click to expand
RapidOCR
├── android # Android project directory
├── api4cpp # C language cross-platform interface library source code directory, directly compile with CMakelists.txt under the root
├── assets # Some pictures for demonstration, not a test set
├── commonlib # common library
├── cpp # C++-based project folder
├── datasets # Additional training datasets
├── dotnet # .Net program directory
├── FAQ.md # Some questions and answers
├── images # Test pictures, two typical test pictures, one is a natural scene, the other is a long text
├── include # The header file directory when compiling the c language interface library
├── ios # Apple mobile phone platform project directory
├── jvm # java-based project directory
├── lib # Compilation library file directory, used to compile the C language interface library. Binary files are not uploaded by default
├── ocrweb # Based on python and Flask web
├── python # python reasoning code directory
├── release #
└── tools # Some conversion scripts and the like
Current Progress
- C++ example (Windows/Linux/macOS): demo
- Jvm example (Java/Kotlin): demo
- .Net example (C#): demo
- Android example: demo
- python example: demo
- IOS example: waiting for someone to contribute code
- Rewrite the C++ reasoning code according to the python version to improve the reasoning effect, and add support for gif/tga/webp format pictures
Model related
Download models( Google Drive|Baidu NetDisk )
Model to onnx
- ⭐PaddleOCRModelConverter by @SWHL
- Paddle2OnnxConvertor by @benjaminwan
- Teach you to use ONNXRunTime to deploy PP-OCR by @Channingss
Compared
Text Det
- test dataset:
Chinese and English (111, including cards, documents and natural images)
| Model | infer_Speed(s/img) | precision | recall | hmean | Model Size |
|---|---|---|---|---|---|
| ch_ppocr_mobile_v2.0_det_infer.onnx | 0.4345742 | 0.7277 | 0.8413 | 0.7785 | 2.3M |
| ch_PP-OCRv2_det_infer.onnx | 0.5116553 | 0.7817 | 0.8472 | 0.8123 | 2.3M |
| ch_PP-OCRv3_det_infer.onnx | 0.5723512 | 0.7740 | 0.8837 | 0.8237 | 2.4M |
Text Recognition
- test dataset:
Chinese and English (168)
| Model | infer_speed(s/img) | Score | Exact_Match | Char_Match | Model Size |
|---|---|---|---|---|---|
| ch_ppocr_mobile_v2.0_rec_infer.onnx | 0.0111 | 0.7287 | 0.5595 | 0.8979 | 4.3M |
| ch_PP-OCRv2_rec_infer.onnx | 0.0193 | 0.6955 | 0.4881 | 0.9029 | 8.0M |
| ch_PP-OCRv3_rec_infer.onnx | 0.0145 | 0.5537 | 0.3274 | 0.7800 | 11M |
| ch_PP-OCRv3_rec_train_student.onnx | 0.0157 | 0.5537 | 0.3274 | 0.7800 | 11M |
| ch_PP-OCRv3_rec_train_teacher.onnx | 0.0140 | 0.5381 | 0.3095 | 0.7667 | 11M |
PaddleOCR-FAQ
Original initiator and start-up author
Acknowledgements
- Many thanks to DeliciaLaniD for fixing the misplaced start position of scan animation in ocrweb.
- Many thanks to zhsunlight for the suggestion about parametric call GPU inference.
Authorization
- The copyright of the OCR model belongs to Baidu, and the copyright of other engineering codes belongs to the owner of this warehouse.
- This software is licensed under LGPL. You are welcome to contribute code, submit an issue or even pr.
Contact us
-
You can contact us through QQ group: 887298230
-
If you can’t find the group number, please click here link to find the organization
-
Scan the following QR code with QQ:





