Go to file
MissPenguin a6ccaa513e
Merge pull request #750 from grasswolfs/update_readme_0918
update readme and related docs
2020-09-19 15:17:02 +08:00
configs add db mv3 yml for v1.1 2020-09-17 02:56:00 +00:00
deploy Merge pull request #744 from wangjiawei04/pdserving_readme 2020-09-17 20:16:00 +08:00
doc test=develop, test=document_fix 2020-09-18 23:13:28 +08:00
ppocr disable se & add cls params for hub serving 2020-09-16 17:33:06 +08:00
tools Merge pull request #741 from WenmuZhou/whl 2020-09-18 18:53:51 +08:00
.clang_format.hook upload lite demo and clang-fomat 2020-07-07 07:40:39 +00:00
.gitignore init commit for build whl 2020-08-22 19:42:14 +08:00
.pre-commit-config.yaml upload PaddleOCR code 2020-05-10 16:26:57 +08:00
.style.yapf upload PaddleOCR code 2020-05-10 16:26:57 +08:00
LICENSE Initial commit 2020-05-08 18:38:17 +08:00
MANIFEST.in init commit for build whl 2020-08-22 19:42:14 +08:00
README.md test=develop, test=document_fix 2020-09-18 23:27:34 +08:00
README_en.md Update README_en.md 2020-09-02 10:05:04 +08:00
__init__.py init commit for build whl 2020-08-22 19:42:14 +08:00
paddleocr.py ppocr支持多语言切换 2020-09-18 11:29:39 +08:00
requirments.txt init commit for build whl 2020-08-22 19:42:14 +08:00
setup.py whl包添加分类模型 2020-09-16 20:00:34 +08:00

README_en.md

English | 简体中文

Introduction

PaddleOCR aims to create rich, leading, and practical OCR tools that help users train better models and apply them into practice.

Recent updates

  • 2020.8.24 Support the use of PaddleOCR through whl package installationpelease refer PaddleOCR Package
  • 2020.8.16, Release text detection algorithm SAST and text recognition algorithm SRN
  • 2020.7.23, Release the playback and PPT of live class on BiliBili station, PaddleOCR Introduction, address
  • 2020.7.15, Add mobile App demo , support both iOS and Android ( based on easyedge and Paddle Lite)
  • 2020.7.15, Improve the deployment ability, add the C + + inference , serving deployment. In addition, the benchmarks of the ultra-lightweight OCR model are provided.
  • 2020.7.15, Add several related datasets, data annotation and synthesis tools.
  • more

Features

  • Ultra-lightweight OCR model, total model size is only 8.6M
    • Single model supports Chinese/English numbers combination recognition, vertical text recognition, long text recognition
    • Detection model DB (4.1M) + recognition model CRNN (4.5M)
  • Various text detection algorithms: EAST, DB
  • Various text recognition algorithms: Rosetta, CRNN, STAR-Net, RARE
  • Support Linux, Windows, macOS and other systems.

Visualization

More visualization

You can also quickly experience the ultra-lightweight OCR : Online Experience

Mobile DEMO experience (based on EasyEdge and Paddle-Lite, supports iOS and Android systems): Sign in to the website to obtain the QR code for installing the App

Also, you can scan the QR code below to install the App (Android support only)

Supported Models:

Model Name Description Detection Model link Recognition Model link Support for space Recognition Model link
db_crnn_mobile ultra-lightweight OCR model inference model / pre-trained model inference model / pre-trained model inference model / pre-train model
db_crnn_server General OCR model inference model / pre-trained model inference model / pre-trained model inference model / pre-train model

Tutorials

Text Detection Algorithm

PaddleOCR open source text detection algorithms list:

On the ICDAR2015 dataset, the text detection result is as follows:

Model Backbone precision recall Hmean Download link
EAST ResNet50_vd 88.18% 85.51% 86.82% Download link
EAST MobileNetV3 81.67% 79.83% 80.74% Download link
DB ResNet50_vd 83.79% 80.65% 82.19% Download link
DB MobileNetV3 75.92% 73.18% 74.53% Download link
SAST ResNet50_vd 92.18% 82.96% 87.33% Download link

On Total-Text dataset, the text detection result is as follows:

Model Backbone precision recall Hmean Download link
SAST ResNet50_vd 88.74% 79.80% 84.03% Download link

Note Additional data, like icdar2013, icdar2017, COCO-Text, ArT, was added to the model training of SAST. Download English public dataset in organized format used by PaddleOCR from Baidu Drive (download code: 2bpi).

For use of LSVT street view dataset with a total of 3w training datathe related configuration and pre-trained models for text detection task are as follows:

Model Backbone Configuration file Pre-trained model
ultra-lightweight OCR model MobileNetV3 det_mv3_db.yml Download link
General OCR model ResNet50_vd det_r50_vd_db.yml Download link
  • Note: For the training and evaluation of the above DB model, post-processing parameters box_thresh=0.6 and unclip_ratio=1.5 need to be set. If using different datasets and different models for training, these two parameters can be adjusted for better result.

For the training guide and use of PaddleOCR text detection algorithms, please refer to the document Text detection model training/evaluation/prediction

Text Recognition Algorithm

PaddleOCR open-source text recognition algorithms list:

Refer to DTRB, the training and evaluation result of these above text recognition (using MJSynth and SynthText for training, evaluate on IIIT, SVT, IC03, IC13, IC15, SVTP, CUTE) is as follow:

Model Backbone Avg Accuracy Module combination Download link
Rosetta Resnet34_vd 80.24% rec_r34_vd_none_none_ctc Download link
Rosetta MobileNetV3 78.16% rec_mv3_none_none_ctc Download link
CRNN Resnet34_vd 82.20% rec_r34_vd_none_bilstm_ctc Download link
CRNN MobileNetV3 79.37% rec_mv3_none_bilstm_ctc Download link
STAR-Net Resnet34_vd 83.93% rec_r34_vd_tps_bilstm_ctc Download link
STAR-Net MobileNetV3 81.56% rec_mv3_tps_bilstm_ctc Download link
RARE Resnet34_vd 84.90% rec_r34_vd_tps_bilstm_attn Download link
RARE MobileNetV3 83.32% rec_mv3_tps_bilstm_attn Download link
SRN Resnet50_vd_fpn 88.33% rec_r50fpn_vd_none_srn Download link

Note SRN model uses data expansion method to expand the two training sets mentioned above, and the expanded data can be downloaded from Baidu Drive (download code: y3ry).

The average accuracy of the two-stage training in the original paper is 89.74%, and that of one stage training in paddleocr is 88.33%. Both pre-trained weights can be downloaded here.

We use LSVT dataset and cropout 30w training data from original photos by using position groundtruth and make some calibration needed. In addition, based on the LSVT corpus, 500w synthetic data is generated to train the model. The related configuration and pre-trained models are as follows:

Model Backbone Configuration file Pre-trained model
ultra-lightweight OCR model MobileNetV3 rec_chinese_lite_train.yml Download link
General OCR model Resnet34_vd rec_chinese_common_train.yml Download link

Please refer to the document for training guide and use of PaddleOCR text recognition algorithms Text recognition model training/evaluation/prediction

Visualization

1.Ultra-lightweight Chinese/English OCR Visualization more

2. General Chinese/English OCR Visualization more

3.Chinese/English OCR Visualization (Space_support) more

FAQ

  1. Error when using attention-based recognition model: KeyError: 'predict'

    The inference of recognition model based on attention loss is still being debugged. For Chinese text recognition, it is recommended to choose the recognition model based on CTC loss first. In practice, it is also found that the recognition model based on attention loss is not as effective as the one based on CTC loss.

  2. About inference speed

    When there are a lot of texts in the picture, the prediction time will increase. You can use --rec_batch_num to set a smaller prediction batch size. The default value is 30, which can be changed to 10 or other values.

  3. Service deployment and mobile deployment

    It is expected that the service deployment based on Serving and the mobile deployment based on Paddle Lite will be released successively in mid-to-late June. Stay tuned for more updates.

  4. Release time of self-developed algorithm

    Baidu Self-developed algorithms such as SAST, SRN and end2end PSL will be released in June or July. Please be patient.

more

Community

Scan the QR code below with your wechat and completing the questionnaire, you can access to offical technical exchange group.

License

This project is released under Apache 2.0 license

Contribution

We welcome all the contributions to PaddleOCR and appreciate for your feedback very much.

  • Many thanks to Khanh Tran and Karl Horky for contributing and revising the English documentation.
  • Many thanks to zhangxin for contributing the new visualize function、add .gitgnore and discard set PYTHONPATH manually.
  • Many thanks to lyl120117 for contributing the code for printing the network structure.
  • Thanks xiangyubo for contributing the handwritten Chinese OCR datasets.
  • Thanks authorfu for contributing Android demo and xiadeye contributing iOS demo, respectively.
  • Thanks BeyondYourself for contributing many great suggestions and simplifying part of the code style.
  • Thanks tangmq for contributing Dockerized deployment services to PaddleOCR and supporting the rapid release of callable Restful API services.