📄 Awesome OCR multiple programing languages toolkits based on ONNX Runtime, OpenVINO, MNN, PaddlePaddle, TensorRT and PyTorch.
Update README
SWHL311c2b73481b
diff --git a/README.md b/README.mdindex 9d4e1d6..e9b8f80 100755--- a/README.md+++ b/README.md@@ -23,6 +23,7 @@- [RapidOCR (捷智OCR)](#rapidocr-捷智ocr)- [简介](#简介)- [近期更新(more)](#近期更新more)+ - [📌2022-06-25 update:](#2022-06-25-update)- [🥟2022-05-25 update](#2022-05-25-update)- [🍿2022-05-15 update](#2022-05-15-update)- [😀2022-05-12 upadte](#2022-05-12-upadte)@@ -59,6 +60,10 @@- 基于百度的开源PaddleOCR 模型及训练,任何人可以使用本推理库,也可以根据自己的需求使用百度的paddlepaddle框架进行模型优化。## 近期更新([more](./docs/change_log.md))+### 📌2022-06-25 update:+- 重新整理python部分推理代码,将常用调节参数全部放到yaml文件中,便于调节,更加容易使用,详情参见:[README](./python/README.md)+- 之前旧的推理代码位于分支:[old_python_infer](https://github.com/RapidAI/RapidOCR/tree/old_python_infer)+#### 🥟2022-05-25 update- 增加基于PaddleOCR v3 rec的python版本推理代码,详情参见[v3 rec](./python/rapidocr_onnxruntime/ch_ppocr_v3_rec)diff --git a/docs/README_en.md b/docs/README_en.mdindex 4035c92..4ca20c5 100644--- a/docs/README_en.md+++ b/docs/README_en.md@@ -22,6 +22,7 @@- [RapidOCR](#rapidocr)- [Introduction](#introduction)- [Recently updates(more)](#recently-updatesmore)+ - [📌2022-06-25 update:](#2022-06-25-update)- [🍿2022-05-15 update](#2022-05-15-update)- [😀2022-05-12 upadte](#2022-05-12-upadte)- [🎧2022-04-04 update](#2022-04-04-update)@@ -57,6 +58,10 @@- 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](./change_log_en.md))+### 📌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](./python/README.md)+- The old inference code is located in the branch: [old_python_infer](https://github.com/RapidAI/RapidOCR/tree/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](https://pan.baidu.com/s/1mkirNltJS481In4g81jP3w?pwd=zy37) | [Google Drive](https://drive.google.com/drive/folders/1x_a9KpCo_1blxH1xFOfgKVkw1HYRVywY?usp=sharing ))- 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.diff --git a/docs/change_log.md b/docs/change_log.mdindex 04d2300..c8ecbca 100644--- a/docs/change_log.md+++ b/docs/change_log.md@@ -1,3 +1,7 @@+### 📌2022-06-25 update:+- 重新整理python部分推理代码,将常用调节参数全部放到yaml文件中,便于调节,更加容易使用+- 详情参见:[README](./python/README.md)+#### 🍿2022-05-15 update- 增加PaddleOCR v3 rec模型转换后的ONNX模型,直接去网盘下载替换即可。([百度网盘](https://pan.baidu.com/s/1mkirNltJS481In4g81jP3w?pwd=zy37) | [Google Drive](https://drive.google.com/drive/folders/1x_a9KpCo_1blxH1xFOfgKVkw1HYRVywY?usp=sharing))- 增加文本识别模型各个版本效果对比表格,详情点击[各个版本ONNX模型效果对比](#各个版本onnx模型效果对比)。v3的文本识别模型从自己构建测试集上的指标来看不如之前的好。diff --git a/docs/change_log_en.md b/docs/change_log_en.mdindex 2f26bdd..4d43f15 100644--- a/docs/change_log_en.md+++ b/docs/change_log_en.md@@ -1,3 +1,7 @@+### 📌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](./python/README.md)+- The old inference code is located in the branch: [old_python_infer](https://github.com/RapidAI/RapidOCR/tree/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](https://pan.baidu.com/s/1mkirNltJS481In4g81jP3w?pwd=zy37) | [Google Drive](https://drive.google.com/drive/folders/1x_a9KpCo_1blxH1xFOfgKVkw1HYRVywY?usp=sharing ))- 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.diff --git a/python/README.md b/python/README.mdindex b4382f3..c9dafec 100755--- a/python/README.md+++ b/python/README.md@@ -1,4 +1,4 @@-### Python版RapidOCR+## Python版RapidOCR<p><a href=""><img src="https://img.shields.io/badge/Python-3.6+-aff.svg"></a><a href=""><img src="https://img.shields.io/badge/OS-Linux%2C%20Win%2C%20Mac-pink.svg"></a>diff --git a/python/rapidocr_openvino/README.md b/python/rapidocr_openvino/README.mdindex 8cc4858..36c3da2 100644--- a/python/rapidocr_openvino/README.md+++ b/python/rapidocr_openvino/README.md@@ -1,4 +1,4 @@-#### 基于OpenVINO推理引擎+### 基于OpenVINO推理引擎- OpenVINO推理方向分类模型有误,已经提了[issue](https://github.com/openvinotoolkit/openvino/issues/11501)→ 问题有已经解决,但是需要自己编译OpenVINO,参见[Answer](https://github.com/openvinotoolkit/openvino/issues/11501#issuecomment-1096366363)#### 安装@@ -22,7 +22,7 @@ pip install openvino-dev==2022.1.0```-### 关于OpenVINO+#### 关于OpenVINO- OpenVINO可以直接推理IR、ONNX和PaddlePaddle模型,具体如下(图来源:[link](https://docs.openvino.ai/latest/openvino_docs_OV_UG_OV_Runtime_User_Guide.html#doxid-openvino-docs-o-v-u-g-o-v-runtime-user-guide)):<div align="center">@@ -39,7 +39,7 @@ pip install openvino-dev==2022.1.0--input_shape "[1,3,960:1200,800]"```-### OpenVINO与ONNXRuntime性能对比+#### OpenVINO与ONNXRuntime性能对比- 推理设备:`Windows 64位 Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz 2.59 GHz`- [测试图像宽高](https://drive.google.com/file/d/1iJcGvOVIdUlyOS52bBdvO8uzx8QORo5M/view?usp=sharing): `12119x810`@@ -50,38 +50,38 @@ pip install openvino-dev==2022.1.0| `ch_PP-OCRv2_det_infer.xml` FP32 动态图 | `openvino=2022.1.0` | 3.175G | 2.0455s |-### OpenVINO与ONNXRuntime推理代码写法对比+#### OpenVINO与ONNXRuntime推理代码写法对比NOTE: 以`ch_ppocr_mobile_v2_det`中推理代码为例子- ONNXRuntime-```python-import onnxruntime--# 声明-sess_opt = onnxruntime.SessionOptions()-sess_opt.log_severity_level = 4-sess_opt.enable_cpu_mem_arena = False-self.session = onnxruntime.InferenceSession(det_model_path, sess_opt)-self.input_name = self.session.get_inputs()[0].name-self.output_name = self.session.get_outputs()[0].name--# 推理-preds = self.session.run([self.output_name],- {self.input_name: img})-```+ ```python+ import onnxruntime++ # 声明+ sess_opt = onnxruntime.SessionOptions()+ sess_opt.log_severity_level = 4+ sess_opt.enable_cpu_mem_arena = False+ self.session = onnxruntime.InferenceSession(det_model_path, sess_opt)+ self.input_name = self.session.get_inputs()[0].name+ self.output_name = self.session.get_outputs()[0].name++ # 推理+ preds = self.session.run([self.output_name],+ {self.input_name: img})+ ```- OpenVINO-```python-from openvino.runtime import Core--# 初始化-ie = Core()-model_onnx = ie.read_model(det_model_path)-compile_model = ie.compile_model(model=model_onnx,- device_name='CPU')-self.vino_session = compile_model.create_infer_request()--# 推理-self.vino_session.infer(inputs=[img])-vino_preds = self.vino_session.get_output_tensor().data-```+ ```python+ from openvino.runtime import Core++ # 初始化+ ie = Core()+ model_onnx = ie.read_model(det_model_path)+ compile_model = ie.compile_model(model=model_onnx,+ device_name='CPU')+ self.vino_session = compile_model.create_infer_request()++ # 推理+ self.vino_session.infer(inputs=[img])+ vino_preds = self.vino_session.get_output_tensor().data+ ```