-[User defined service module modification](#user-defined-service-module-modification)
-[4. Returned result format](#4-returned-result-format)
-[5. User defined service module modification](#5-user-defined-service-module-modification)
PaddleOCR provides 2 service deployment methods:
PaddleOCR provides 2 service deployment methods:
...
@@ -19,7 +20,7 @@ PaddleOCR provides 2 service deployment methods:
...
@@ -19,7 +20,7 @@ PaddleOCR provides 2 service deployment methods:
# Service deployment based on PaddleHub Serving
# Service deployment based on PaddleHub Serving
The hubserving service deployment directory includes three service packages: text detection, text recognition, two-stage series connection and table recognition. Please select the corresponding service package to install and start service according to your needs. The directory is as follows:
The hubserving service deployment directory includes five service packages: text detection, text recognition, two-stage series connection, table recognition and PP-Structure. Please select the corresponding service package to install and start service according to your needs. The directory is as follows:
```
```
deploy/hubserving/
deploy/hubserving/
└─ ocr_det text detection module service package
└─ ocr_det text detection module service package
...
@@ -38,18 +39,22 @@ deploy/hubserving/ocr_system/
...
@@ -38,18 +39,22 @@ deploy/hubserving/ocr_system/
└─ module.py Main module file, required, contains the complete logic of the service
└─ module.py Main module file, required, contains the complete logic of the service
└─ params.py Parameter file, required, including parameters such as model path, pre- and post-processing parameters
└─ params.py Parameter file, required, including parameters such as model path, pre- and post-processing parameters
```
```
## 1. Update
## Quick start service
* 2022.03.30 add PP-Structure and table recognition services。
## 2. Quick start service
The following steps take the 2-stage series service as an example. If only the detection service or recognition service is needed, replace the corresponding file path.
The following steps take the 2-stage series service as an example. If only the detection service or recognition service is needed, replace the corresponding file path.
Before installing the service module, you need to prepare the inference model and put it in the correct path. By default, the PP-OCRv2 models are used, and the default model path is:
Before installing the service module, you need to prepare the inference model and put it in the correct path. By default, the PP-OCRv2 models are used, and the default model path is:
```
```
text detection model: ./inference/ch_PP-OCRv2_det_infer/
text detection model: ./inference/ch_PP-OCRv2_det_infer/
**The model path can be found and modified in `params.py`.** More models provided by PaddleOCR can be obtained from the [model library](../../doc/doc_en/models_list_en.md). You can also use models trained by yourself.
**The model path can be found and modified in `params.py`.** More models provided by PaddleOCR can be obtained from the [model library](../../doc/doc_en/models_list_en.md). You can also use models trained by yourself.
### 3. Install Service Module
### 2.3 Install Service Module
PaddleOCR provides 5 kinds of service modules, install the required modules according to your needs.
PaddleOCR provides 5 kinds of service modules, install the required modules according to your needs.
The returned result is a list. Each item in the list is a dict. The dict may contain three fields. The information is as follows:
The returned result is a list. Each item in the list is a dict. The dict may contain three fields. The information is as follows:
|field name|data type|description|
|field name|data type|description|
...
@@ -219,7 +224,7 @@ The fields returned by different modules are different. For example, the results
...
@@ -219,7 +224,7 @@ The fields returned by different modules are different. For example, the results
**Note:** If you need to add, delete or modify the returned fields, you can modify the file `module.py` of the corresponding module. For the complete process, refer to the user-defined modification service module in the next section.
**Note:** If you need to add, delete or modify the returned fields, you can modify the file `module.py` of the corresponding module. For the complete process, refer to the user-defined modification service module in the next section.
## User defined service module modification
## 5. User defined service module modification
If you need to modify the service logic, the following steps are generally required (take the modification of `ocr_system` for example):
If you need to modify the service logic, the following steps are generally required (take the modification of `ocr_system` for example):