Files
rapidocr/docs
2022-12-19 14:07:19 +08:00
..
2022-12-19 13:24:49 +08:00
2022-12-19 13:24:49 +08:00
2022-12-19 14:07:19 +08:00
2022-12-14 17:18:38 +08:00
2022-12-14 17:18:38 +08:00
2022-07-13 18:53:17 +08:00
2022-12-19 13:24:49 +08:00
2022-07-20 21:22:01 +08:00

RapidOCR (Open source OCR for the security of the digital world)

简体中文 | English

Open in Colab
PyPI

Contents

Introduction

  • Completely open source, free and support offline deployment of multi-platform and multi-language OCR.

  • 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.

Navigation

Recently updates(more)

⚽2022-12-19 update:

  • [python] Add the table recovery module, See Rapid Table for details.

🤖2022-12-14 update:

  • [python] Move the configuration parameters and model into the module, and at the same time put the model into the whl package, which can be directly installed and used by pip, which is more convenient and quicker.
  • For details, see: README

🧻2022-11-20 update:

  • [python] Add the layout analysis part, which supports the detection and analysis of three layouts: Chinese, English and tables. See: Rapid Structure section for details.

Overall Framework

flowchart LR
    subgraph Step
    direction TB
    C(Text Det) --> D(Text Cls) --> E(Text Rec)
    end

    A[/OurSelf Dataset/] --> B(PaddleOCR) --Train--> Step --Convert--> F(ONNX)
    F --> G{RapidOCR Deploy\n<b>Python/C++/Java/C#</b>}
    G --> H(Windows x86/x64) & I(Linux) & J(Android) & K(Web) & L(Raspberry Pi)

    click B "https://github.com/PaddlePaddle/PaddleOCR" _blank

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

Demo

  • Online demo
    • If the demo fails, you can visit the demo on Hugging Face: RapidOCRDemo
    • Note: This online demo does not store any image data uploaded and tested by friends. For details, please refer to: ocrweb/README
    • 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:
  • Hugging Face Demo
    • The demo is built on Hugging Face's Spaces, generated by the Gradio library, and adds three hyperparameters:
      • box_thresh: The probability that the detected box is text, the larger the value, the higher the probability that the box is text.
      • unclip_ratio: Controls the size of the detected text box, the larger the value, the larger the detection box as a whole.
      • text_score: The confidence that the text recognition result is correct, the larger the value, the more accurate the displayed recognition result.
    • Demo:

TODO

  • 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

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.
  • Many thanks to AutumnSun1996 for the suggestiong in the #42.

Sponsor

Sponsor Applied Products
-
  • If you want to sponsor the project, you can directly click the Sponsor button at the top of the current page, please write a note (e.g. your github account name) to facilitate adding to the sponsorship list above.

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