Files
rapidocr/docs
2022-07-08 22:07:00 +08:00
..
2022-07-08 09:12:38 +08:00
2022-07-07 23:02:00 +08:00
2022-06-25 20:59:02 +08:00
2022-07-08 22:07:00 +08:00

RapidOCR

简体中文 | English

Open in Colab

Contents

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-07 update:

  • Fix the bug of v3 rec inference in python version, and merge v3 rec and v2 rec into the same set of inference code, which is more concise and convenient.
  • Add unit test under python module
  • Add Acknowledgement module to this page to thank the partners who contributed to this project.

😁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-gpu version 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. 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.

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 CMake-windows-x86-x64 Download Link
Linux x64 CMake-linux Not available yet, compile by yourself

Online demo

  • Web demo
  • The model combination (optimal combination) used for the demo is: ch_PP-OCRv3_det + ch_ppocr_mobile_v2.0_cls + ch_PP-OCRv3_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
    ├── docs            # some docs
    ├── dotnet          # .Net program directory
    ├── 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

Download models(Baidu NetDisk | Google Drive)

Model to onnx

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 parameterized call GPU reasoning and the careful and thoughtful testing.
  • Many thanks to lzh111222334 for fixing some bugs of rec preprocessing under python version.

Sponsor

Sponsor Applied Products

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:

Demo

Demonstration with C++/JVM

Demonstration with .Net

Demonstratioin with multi_language