You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: deploy/cpp_infer/readme_en.md
+35-28Lines changed: 35 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,8 @@
1
1
# Server-side C++ Inference
2
2
3
-
This chapter introduces the C++ deployment method of the PaddleOCR model, and the corresponding python predictive deployment method refers to [document](../../doc/doc_ch/inference.md).
4
-
C++ is better than python in terms of performance calculation. Therefore, in most CPU and GPU deployment scenarios, C++ deployment is mostly used.
5
-
This section will introduce how to configure the C++ environment and complete it in the Linux\Windows (CPU\GPU) environment
6
-
PaddleOCR model deployment.
3
+
This chapter introduces the C++ deployment steps of the PaddleOCR model. The corresponding Python predictive deployment method refers to [document](../../doc/doc_ch/inference.md).
4
+
C++ is better than python in terms of performance. Therefore, in CPU and GPU deployment scenarios, C++ deployment is mostly used.
5
+
This section will introduce how to configure the C++ environment and deploy PaddleOCR in Linux (CPU\GPU) environment. For Windows deployment please refer to [Windows](./docs/windows_vs2019_build.md) compilation guidelines.
7
6
8
7
9
8
## 1. Prepare the Environment
@@ -15,17 +14,17 @@ PaddleOCR model deployment.
15
14
16
15
### 1.1 Compile OpenCV
17
16
18
-
* First of all, you need to download the source code compiled package in the Linux environment from the opencv official website. Taking opencv3.4.7 as an example, the download command is as follows.
17
+
* First of all, you need to download the source code compiled package in the Linux environment from the OpenCV official website. Taking OpenCV 3.4.7 as an example, the download command is as follows.
Finally, you can see the folder of `opencv-3.4.7/` in the current directory.
25
+
Finally, you will see the folder of `opencv-3.4.7/` in the current directory.
27
26
28
-
* Compile opencv, the opencv source path (`root_path`) and installation path (`install_path`) should be set by yourself. Enter the opencv source code path and compile it in the following way.
27
+
* Compile OpenCV, the OpenCV source path (`root_path`) and installation path (`install_path`) should be set by yourself. Enter the OpenCV source code path and compile it in the following way.
29
28
30
29
31
30
```shell
@@ -58,11 +57,11 @@ make -j
58
57
make install
59
58
```
60
59
61
-
Among them, `root_path` is the downloaded opencv source code path, and `install_path` is the installation path of opencv. After `make install` is completed, the opencv header file and library file will be generated in this folder for later OCR source code compilation.
60
+
In the above commands, `root_path` is the downloaded OpenCV source code path, and `install_path` is the installation path of OpenCV. After `make install` is completed, the OpenCV header file and library file will be generated in this folder for later OCR source code compilation.
62
61
63
62
64
63
65
-
The final file structure under the opencv installation path is as follows.
64
+
The final file structure under the OpenCV installation path is as follows.
66
65
67
66
```
68
67
opencv3/
@@ -79,28 +78,28 @@ opencv3/
79
78
80
79
#### 1.2.1 Direct download and installation
81
80
82
-
[Paddle inference library official website](https://paddle-inference.readthedocs.io/en/latest/user_guides/download_lib.html). You can view and select the appropriate version of the inference library on the official website.
81
+
[Paddle inference library official website](https://paddle-inference.readthedocs.io/en/latest/user_guides/download_lib.html). You can review and select the appropriate version of the inference library on the official website.
83
82
84
83
85
-
* After downloading, use the following method to uncompress.
84
+
* After downloading, use the following command to extract files.
86
85
87
86
```
88
87
tar -xf paddle_inference.tgz
89
88
```
90
89
91
-
Finally you can see the following files in the folder of `paddle_inference/`.
90
+
Finally you will see the the folder of `paddle_inference/` in the current path.
92
91
93
-
#### 1.2.2 Compile from the source code
94
-
* If you want to get the latest Paddle inference library features, you can download the latest code from Paddle github repository and compile the inference library from the source code. It is recommended to download the inference library with paddle version greater than or equal to 2.0.1.
95
-
* You can refer to [Paddle inference library] (https://www.paddlepaddle.org.cn/documentation/docs/en/advanced_guide/inference_deployment/inference/build_and_install_lib_en.html) to get the Paddle source code from github, and then compile To generate the latest inference library. The method of using git to access the code is as follows.
92
+
#### 1.2.2 Compile the inference source code
93
+
* If you want to get the latest Paddle inference library features, you can download the latest code from Paddle GitHub repository and compile the inference library from the source code. It is recommended to download the inference library with paddle version greater than or equal to 2.0.1.
94
+
* You can refer to [Paddle inference library] (https://www.paddlepaddle.org.cn/documentation/docs/en/advanced_guide/inference_deployment/inference/build_and_install_lib_en.html) to get the Paddle source code from GitHub, and then compile To generate the latest inference library. The method of using git to access the code is as follows.
Among them, `paddle` is the Paddle library required for C++ prediction later, and `version.txt` contains the version information of the current inference library.
135
+
`paddle` is the Paddle library required for C++ prediction later, and `version.txt` contains the version information of the current inference library.
137
136
138
137
139
138
## 2. Compile and Run the Demo
140
139
141
140
### 2.1 Export the inference model
142
141
143
-
* You can refer to [Model inference](../../doc/doc_ch/inference.md),export the inference model. After the model is exported, assuming it is placed in the `inference` directory, the directory structure is as follows.
142
+
* You can refer to [Model inference](../../doc/doc_ch/inference.md) and export the inference model. After the model is exported, assuming it is placed in the `inference` directory, the directory structure is as follows.
`OPENCV_DIR` is the opencv installation path; `LIB_DIR` is the download (`paddle_inference` folder)
173
+
`OPENCV_DIR` is the OpenCV installation path; `LIB_DIR` is the download (`paddle_inference` folder)
175
174
or the generated Paddle inference library path (`build/paddle_inference_install_dir` folder);
176
-
`CUDA_LIB_DIR` is the cuda library file path, in docker; it is `/usr/local/cuda/lib64`; `CUDNN_LIB_DIR` is the cudnn library file path, in docker it is `/usr/lib/x86_64-linux-gnu/`.
175
+
`CUDA_LIB_DIR` is the CUDA library file path, in docker; it is `/usr/local/cuda/lib64`; `CUDNN_LIB_DIR` is the cuDNN library file path, in docker it is `/usr/lib/x86_64-linux-gnu/`.
177
176
178
177
179
178
* After the compilation is completed, an executable file named `ppocr` will be generated in the `build` folder.
180
179
181
180
182
181
### Run the demo
183
-
Execute the built executable file:
182
+
Execute the built executable file:
184
183
```shell
185
184
./build/ppocr <mode> [--param1] [--param2] [...]
186
185
```
187
-
Here, `mode` is a required parameter,and the value range is ['det', 'rec', 'system'], representing using detection only, using recognition only and using the end-to-end system respectively. Specifically,
186
+
`mode` is a required parameter,and the valid values are
187
+
188
+
mode value | Model used
189
+
-----|------
190
+
det | Detection only
191
+
rec | Recognition only
192
+
system | End-to-end system
193
+
194
+
Specifically,
188
195
189
196
##### 1. run det demo:
190
197
```shell
@@ -214,9 +221,9 @@ Here, `mode` is a required parameter,and the value range is ['det', 'rec', 'sy
214
221
--image_dir=../../doc/imgs/12.jpg
215
222
```
216
223
217
-
More parameters are as follows,
224
+
More parameters are as follows,
218
225
219
-
-common parameters
226
+
-Common parameters
220
227
221
228
|parameter|data type|default|meaning|
222
229
| --- | --- | --- | --- |
@@ -226,7 +233,7 @@ More parameters are as follows,
226
233
|cpu_math_library_num_threads|int|10|Number of threads when using CPU inference. When machine cores is enough, the large the value, the faster the inference speed|
227
234
|use_mkldnn|bool|true|Whether to use mkdlnn library|
228
235
229
-
-detection related parameters
236
+
-Detection related parameters
230
237
231
238
|parameter|data type|default|meaning|
232
239
| --- | --- | --- | --- |
@@ -238,15 +245,15 @@ More parameters are as follows,
238
245
|use_polygon_score|bool|false|Whether to use polygon box to calculate bbox score, false means to use rectangle box to calculate. Use rectangular box to calculate faster, and polygonal box more accurate for curved text area.|
239
246
|visualize|bool|true|Whether to visualize the results,when it is set as true, The prediction result will be save in the image file `./ocr_vis.png`.|
240
247
241
-
-classifier related parameters
248
+
-Classifier related parameters
242
249
243
250
|parameter|data type|default|meaning|
244
251
| --- | --- | --- | --- |
245
252
|use_angle_cls|bool|false|Whether to use the direction classifier|
246
253
|cls_model_dir|string|-|Address of direction classifier inference model|
247
254
|cls_thresh|float|0.9|Score threshold of the direction classifier|
248
255
249
-
-recogniton related parameters
256
+
-Recognition related parameters
250
257
251
258
|parameter|data type|default|meaning|
252
259
| --- | --- | --- | --- |
@@ -265,4 +272,4 @@ The detection results will be shown on the screen, which is as follows.
265
272
266
273
### 2.3 Notes
267
274
268
-
*Paddle2.0.0 inference model library is recommended for this toturial.
275
+
*Paddle 2.0.0 inference model library is recommended for this tutorial.
Copy file name to clipboardExpand all lines: deploy/docker/hubserving/README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
English | [简体中文](README_cn.md)
2
2
3
3
## Introduction
4
-
Many users hope package the PaddleOCR service into a docker image, so that it can be quickly released and used in the docker or k8s environment.
4
+
Many users hope package the PaddleOCR service into a docker image, so that it can be quickly released and used in the docker or K8s environment.
5
5
6
-
This page provides some standardized code to achieve this goal. You can quickly publish the PaddleOCR project into a callable Restful API service through the following steps. (At present, the deployment based on the HubServing mode is implemented first, and author plans to increase the deployment of the PaddleServing mode in the futrue)
6
+
This page provides some standardized code to achieve this goal. You can quickly publish the PaddleOCR project into a callable Restful API service through the following steps. (At present, the deployment based on the HubServing mode is implemented first, and author plans to increase the deployment of the PaddleServing mode in the future)
7
7
8
8
## 1. Prerequisites
9
9
@@ -14,7 +14,7 @@ c. NVIDIA Container Toolkit(GPU,Docker 19.03+ can skip this)
14
14
d. cuDNN 7.6+(GPU)
15
15
16
16
## 2. Build Image
17
-
a. Goto Dockerfile directory(ps:Need to distinguish between cpu and gpu version, the following takes cpu as an example, gpu version needs to replace the keyword)
17
+
a. Go to Dockerfile directory(PS: Need to distinguish between CPU and GPU version, the following takes CPU as an example, GPU version needs to replace the keyword)
18
18
```
19
19
cd deploy/docker/hubserving/cpu
20
20
```
@@ -42,13 +42,13 @@ docker logs -f paddle_ocr
42
42
```
43
43
44
44
## 4. Test
45
-
a. Calculate the Base64 encoding of the picture to be recognized (if you just test, you can use a free online tool, like:https://freeonlinetools24.com/base64-image/)
45
+
a. Calculate the Base64 encoding of the picture to be recognized (For test purpose, you can use a free online tool such as https://freeonlinetools24.com/base64-image/ )
46
46
b. Post a service request(sample request in sample_request.txt)
47
47
48
48
```
49
49
curl -H "Content-Type:application/json" -X POST --data "{\"images\": [\"Input image Base64 encode(need to delete the code 'data:image/jpg;base64,')\"]}" http://localhost:8868/predict/ocr_system
50
50
```
51
-
c. Get resposne(If the call is successful, the following result will be returned)
51
+
c. Get response(If the call is successful, the following result will be returned)
Copy file name to clipboardExpand all lines: deploy/lite/readme_en.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Tutorial of PaddleOCR Mobile deployment
2
2
3
-
This tutorial will introduce how to use [Paddle Lite](https://github.com/PaddlePaddle/Paddle-Lite) to deploy paddleOCR ultra-lightweight Chinese and English detection models on mobile phones.
3
+
This tutorial will introduce how to use [Paddle Lite](https://github.com/PaddlePaddle/Paddle-Lite) to deploy PaddleOCR ultra-lightweight Chinese and English detection models on mobile phones.
4
4
5
-
paddle-lite is a lightweight inference engine for PaddlePaddle. It provides efficient inference capabilities for mobile phones and IoTs, and extensively integrates cross-platform hardware to provide lightweight deployment solutions for end-side deployment issues.
5
+
paddle-lite is a lightweight inference engine for PaddlePaddle. It provides efficient inference capabilities for mobile phones and IoT, and extensively integrates cross-platform hardware to provide lightweight deployment solutions for end-side deployment issues.
0 commit comments