|
@@ -456,11 +456,19 @@ SVTRv2 is a server text recognition model developed by the OpenOCR team of Fudan
|
|
|
|
|
|
|
|
|
|
|
|
|
## 2. Quick Start
|
|
## 2. Quick Start
|
|
|
-The pre-trained model pipelines provided by PaddleX can be quickly experienced. You can experience the seal text recognition pipeline locally using the command line or Python.
|
|
|
|
|
|
|
+All model production lines provided by PaddleX can be quickly experienced. You can experience the effect of the seal text recognition pipeline on the community platform, or you can use the command line or Python locally to experience the effect of the seal text recognition pipeline.
|
|
|
|
|
|
|
|
-Before using the seal text recognition pipeline locally, please ensure that you have completed the installation of the PaddleX wheel package according to the [PaddleX Local Installation Tutorial](../../../installation/installation.en.md).
|
|
|
|
|
|
|
+### 2.1 Online Experience
|
|
|
|
|
+You can [experience the seal text recognition pipeline online](https://aistudio.baidu.com/community/app/387977/webUI?source=appCenter) by recognizing the demo images provided by the official platform, for example:
|
|
|
|
|
|
|
|
-### 2.1 Command Line Experience
|
|
|
|
|
|
|
+<img src="https://raw.githubusercontent.com/cuicheng01/PaddleX_doc_images/main/images/pipelines/seal_recognition/seal_aistudio.png"/>
|
|
|
|
|
+
|
|
|
|
|
+If you are satisfied with the performance of the production line, you can directly integrate and deploy it. You can choose to download the deployment package from the cloud, or refer to the methods in [Section 2.2 Local Experience](#22-local-experience) for local deployment. If you are not satisfied with the effect, you can <b>fine-tune the models in the production line using your private data</b>. If you have local hardware resources for training, you can start training directly on your local machine; if not, the Star River Zero-Code platform provides a one-click training service. You don't need to write any code—just upload your data and start the training task with one click.
|
|
|
|
|
+
|
|
|
|
|
+### 2.2 Local Experience
|
|
|
|
|
+> ❗ Before using the seal text recognition pipeline locally, please ensure that you have completed the installation of the PaddleX wheel package according to the [PaddleX Installation Guide](../../../installation/installation.en.md).
|
|
|
|
|
+
|
|
|
|
|
+#### 2.2.1 Command Line Experience
|
|
|
You can quickly experience the seal text recognition pipeline with a single command. Use the [test file](https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/seal_text_det.png), and replace `--input` with the local path for prediction.
|
|
You can quickly experience the seal text recognition pipeline with a single command. Use the [test file](https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/seal_text_det.png), and replace `--input` with the local path for prediction.
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
@@ -479,234 +487,22 @@ After running, the results will be printed to the terminal, as follows:
|
|
|
<details><summary> 👉Click to Expand</summary>
|
|
<details><summary> 👉Click to Expand</summary>
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
-{'res': {'input_path': 'seal_text_det.png', 'model_settings': {'use_doc_preprocessor': False, 'use_layout_detection': True}, 'layout_det_res': {'input_path': None, 'page_index': None, 'boxes': [{'cls_id': 16, 'label': 'seal', 'score': 0.975529670715332, 'coordinate': [6.191284, 0.16680908, 634.39325, 628.85345]}]}, 'seal_res_list': [{'input_path': None, 'page_index': None, 'model_settings': {'use_doc_preprocessor': False, 'use_textline_orientation': False}, 'dt_polys': [array([[320, 38],
|
|
|
|
|
- [479, 92],
|
|
|
|
|
- [483, 94],
|
|
|
|
|
- [486, 97],
|
|
|
|
|
- [579, 226],
|
|
|
|
|
- [582, 230],
|
|
|
|
|
- [582, 235],
|
|
|
|
|
- [584, 383],
|
|
|
|
|
- [584, 388],
|
|
|
|
|
- [582, 392],
|
|
|
|
|
- [578, 396],
|
|
|
|
|
- [573, 398],
|
|
|
|
|
- [566, 398],
|
|
|
|
|
- [502, 380],
|
|
|
|
|
- [497, 377],
|
|
|
|
|
- [494, 374],
|
|
|
|
|
- [491, 369],
|
|
|
|
|
- [491, 366],
|
|
|
|
|
- [488, 259],
|
|
|
|
|
- [424, 172],
|
|
|
|
|
- [318, 136],
|
|
|
|
|
- [251, 154],
|
|
|
|
|
- [200, 174],
|
|
|
|
|
- [137, 260],
|
|
|
|
|
- [133, 366],
|
|
|
|
|
- [132, 370],
|
|
|
|
|
- [130, 375],
|
|
|
|
|
- [126, 378],
|
|
|
|
|
- [123, 380],
|
|
|
|
|
- [ 60, 398],
|
|
|
|
|
- [ 55, 398],
|
|
|
|
|
- [ 49, 397],
|
|
|
|
|
- [ 45, 394],
|
|
|
|
|
- [ 43, 390],
|
|
|
|
|
- [ 41, 383],
|
|
|
|
|
- [ 43, 236],
|
|
|
|
|
- [ 44, 230],
|
|
|
|
|
- [ 45, 227],
|
|
|
|
|
- [141, 96],
|
|
|
|
|
- [144, 93],
|
|
|
|
|
- [148, 90],
|
|
|
|
|
- [311, 38],
|
|
|
|
|
|
|
+{'res': {'input_path': 'seal_text_det.png', 'model_settings': {'use_doc_preprocessor': False, 'use_layout_detection': True}, 'layout_det_res': {'input_path': None, 'page_index': None, 'boxes': [{'cls_id': 16, 'label': 'seal', 'score': 0.975531280040741, 'coordinate': [6.195526, 0.1579895, 634.3982, 628.84595]}]}, 'seal_res_list': [{'input_path': None, 'page_index': None, 'model_settings': {'use_doc_preprocessor': False, 'use_textline_orientation': False}, 'dt_polys': [array([[320, 38],
|
|
|
|
|
+ ...,
|
|
|
[315, 38]]), array([[461, 347],
|
|
[315, 38]]), array([[461, 347],
|
|
|
- [465, 350],
|
|
|
|
|
- [468, 354],
|
|
|
|
|
- [470, 360],
|
|
|
|
|
- [470, 425],
|
|
|
|
|
- [469, 429],
|
|
|
|
|
- [467, 433],
|
|
|
|
|
- [462, 437],
|
|
|
|
|
- [456, 439],
|
|
|
|
|
- [169, 439],
|
|
|
|
|
- [165, 439],
|
|
|
|
|
- [160, 436],
|
|
|
|
|
- [157, 432],
|
|
|
|
|
- [155, 426],
|
|
|
|
|
- [154, 360],
|
|
|
|
|
- [155, 356],
|
|
|
|
|
- [158, 352],
|
|
|
|
|
- [161, 348],
|
|
|
|
|
- [168, 346],
|
|
|
|
|
|
|
+ ...,
|
|
|
[456, 346]]), array([[439, 445],
|
|
[456, 346]]), array([[439, 445],
|
|
|
- [441, 447],
|
|
|
|
|
- [443, 451],
|
|
|
|
|
- [444, 453],
|
|
|
|
|
- [444, 497],
|
|
|
|
|
- [443, 502],
|
|
|
|
|
- [440, 504],
|
|
|
|
|
- [437, 506],
|
|
|
|
|
- [434, 507],
|
|
|
|
|
- [189, 505],
|
|
|
|
|
- [184, 504],
|
|
|
|
|
- [182, 502],
|
|
|
|
|
- [180, 498],
|
|
|
|
|
- [179, 496],
|
|
|
|
|
- [181, 453],
|
|
|
|
|
- [182, 449],
|
|
|
|
|
- [184, 446],
|
|
|
|
|
- [188, 444],
|
|
|
|
|
|
|
+ ...,
|
|
|
[434, 444]]), array([[158, 468],
|
|
[434, 444]]), array([[158, 468],
|
|
|
- [199, 502],
|
|
|
|
|
- [242, 522],
|
|
|
|
|
- [299, 534],
|
|
|
|
|
- [339, 532],
|
|
|
|
|
- [373, 526],
|
|
|
|
|
- [417, 508],
|
|
|
|
|
- [459, 475],
|
|
|
|
|
- [462, 474],
|
|
|
|
|
- [467, 474],
|
|
|
|
|
- [472, 476],
|
|
|
|
|
- [502, 507],
|
|
|
|
|
- [503, 510],
|
|
|
|
|
- [504, 515],
|
|
|
|
|
- [503, 518],
|
|
|
|
|
- [501, 521],
|
|
|
|
|
- [452, 559],
|
|
|
|
|
- [450, 560],
|
|
|
|
|
- [391, 584],
|
|
|
|
|
- [390, 584],
|
|
|
|
|
- [372, 590],
|
|
|
|
|
- [370, 590],
|
|
|
|
|
- [305, 596],
|
|
|
|
|
- [302, 596],
|
|
|
|
|
- [224, 581],
|
|
|
|
|
- [221, 580],
|
|
|
|
|
- [164, 553],
|
|
|
|
|
- [162, 551],
|
|
|
|
|
- [114, 509],
|
|
|
|
|
- [112, 507],
|
|
|
|
|
- [111, 503],
|
|
|
|
|
- [112, 498],
|
|
|
|
|
- [114, 496],
|
|
|
|
|
- [146, 468],
|
|
|
|
|
- [149, 466],
|
|
|
|
|
- [154, 466]])], 'text_det_params': {'limit_side_len': 736, 'limit_type': 'min', 'thresh': 0.2, 'box_thresh': 0.6, 'unclip_ratio': 0.5}, 'text_type': 'seal', 'textline_orientation_angles': [-1, -1, -1, -1], 'text_rec_score_thresh': 0, 'rec_texts': ['天津君和缘商贸有限公司', '发票专用章', '吗繁物', '5263647368706'], 'rec_scores': [0.9934046268463135, 0.9999403953552246, 0.998250424861908, 0.9913849234580994], 'rec_polys': [array([[320, 38],
|
|
|
|
|
- [479, 92],
|
|
|
|
|
- [483, 94],
|
|
|
|
|
- [486, 97],
|
|
|
|
|
- [579, 226],
|
|
|
|
|
- [582, 230],
|
|
|
|
|
- [582, 235],
|
|
|
|
|
- [584, 383],
|
|
|
|
|
- [584, 388],
|
|
|
|
|
- [582, 392],
|
|
|
|
|
- [578, 396],
|
|
|
|
|
- [573, 398],
|
|
|
|
|
- [566, 398],
|
|
|
|
|
- [502, 380],
|
|
|
|
|
- [497, 377],
|
|
|
|
|
- [494, 374],
|
|
|
|
|
- [491, 369],
|
|
|
|
|
- [491, 366],
|
|
|
|
|
- [488, 259],
|
|
|
|
|
- [424, 172],
|
|
|
|
|
- [318, 136],
|
|
|
|
|
- [251, 154],
|
|
|
|
|
- [200, 174],
|
|
|
|
|
- [137, 260],
|
|
|
|
|
- [133, 366],
|
|
|
|
|
- [132, 370],
|
|
|
|
|
- [130, 375],
|
|
|
|
|
- [126, 378],
|
|
|
|
|
- [123, 380],
|
|
|
|
|
- [ 60, 398],
|
|
|
|
|
- [ 55, 398],
|
|
|
|
|
- [ 49, 397],
|
|
|
|
|
- [ 45, 394],
|
|
|
|
|
- [ 43, 390],
|
|
|
|
|
- [ 41, 383],
|
|
|
|
|
- [ 43, 236],
|
|
|
|
|
- [ 44, 230],
|
|
|
|
|
- [ 45, 227],
|
|
|
|
|
- [141, 96],
|
|
|
|
|
- [144, 93],
|
|
|
|
|
- [148, 90],
|
|
|
|
|
- [311, 38],
|
|
|
|
|
|
|
+ ...,
|
|
|
|
|
+ [154, 466]])], 'text_det_params': {'limit_side_len': 736, 'limit_type': 'min', 'thresh': 0.2, 'box_thresh': 0.6, 'unclip_ratio': 0.5}, 'text_type': 'seal', 'textline_orientation_angles': array([-1, ..., -1]), 'text_rec_score_thresh': 0, 'rec_texts': ['天津君和缘商贸有限公司', '发票专用章', '吗繁物', '5263647368706'], 'rec_scores': array([0.9934051 , ..., 0.99139398]), 'rec_polys': [array([[320, 38],
|
|
|
|
|
+ ...,
|
|
|
[315, 38]]), array([[461, 347],
|
|
[315, 38]]), array([[461, 347],
|
|
|
- [465, 350],
|
|
|
|
|
- [468, 354],
|
|
|
|
|
- [470, 360],
|
|
|
|
|
- [470, 425],
|
|
|
|
|
- [469, 429],
|
|
|
|
|
- [467, 433],
|
|
|
|
|
- [462, 437],
|
|
|
|
|
- [456, 439],
|
|
|
|
|
- [169, 439],
|
|
|
|
|
- [165, 439],
|
|
|
|
|
- [160, 436],
|
|
|
|
|
- [157, 432],
|
|
|
|
|
- [155, 426],
|
|
|
|
|
- [154, 360],
|
|
|
|
|
- [155, 356],
|
|
|
|
|
- [158, 352],
|
|
|
|
|
- [161, 348],
|
|
|
|
|
- [168, 346],
|
|
|
|
|
|
|
+ ...,
|
|
|
[456, 346]]), array([[439, 445],
|
|
[456, 346]]), array([[439, 445],
|
|
|
- [441, 447],
|
|
|
|
|
- [443, 451],
|
|
|
|
|
- [444, 453],
|
|
|
|
|
- [444, 497],
|
|
|
|
|
- [443, 502],
|
|
|
|
|
- [440, 504],
|
|
|
|
|
- [437, 506],
|
|
|
|
|
- [434, 507],
|
|
|
|
|
- [189, 505],
|
|
|
|
|
- [184, 504],
|
|
|
|
|
- [182, 502],
|
|
|
|
|
- [180, 498],
|
|
|
|
|
- [179, 496],
|
|
|
|
|
- [181, 453],
|
|
|
|
|
- [182, 449],
|
|
|
|
|
- [184, 446],
|
|
|
|
|
- [188, 444],
|
|
|
|
|
|
|
+ ...,
|
|
|
[434, 444]]), array([[158, 468],
|
|
[434, 444]]), array([[158, 468],
|
|
|
- [199, 502],
|
|
|
|
|
- [242, 522],
|
|
|
|
|
- [299, 534],
|
|
|
|
|
- [339, 532],
|
|
|
|
|
- [373, 526],
|
|
|
|
|
- [417, 508],
|
|
|
|
|
- [459, 475],
|
|
|
|
|
- [462, 474],
|
|
|
|
|
- [467, 474],
|
|
|
|
|
- [472, 476],
|
|
|
|
|
- [502, 507],
|
|
|
|
|
- [503, 510],
|
|
|
|
|
- [504, 515],
|
|
|
|
|
- [503, 518],
|
|
|
|
|
- [501, 521],
|
|
|
|
|
- [452, 559],
|
|
|
|
|
- [450, 560],
|
|
|
|
|
- [391, 584],
|
|
|
|
|
- [390, 584],
|
|
|
|
|
- [372, 590],
|
|
|
|
|
- [370, 590],
|
|
|
|
|
- [305, 596],
|
|
|
|
|
- [302, 596],
|
|
|
|
|
- [224, 581],
|
|
|
|
|
- [221, 580],
|
|
|
|
|
- [164, 553],
|
|
|
|
|
- [162, 551],
|
|
|
|
|
- [114, 509],
|
|
|
|
|
- [112, 507],
|
|
|
|
|
- [111, 503],
|
|
|
|
|
- [112, 498],
|
|
|
|
|
- [114, 496],
|
|
|
|
|
- [146, 468],
|
|
|
|
|
- [149, 466],
|
|
|
|
|
|
|
+ ...,
|
|
|
[154, 466]])], 'rec_boxes': array([], dtype=float64)}]}}
|
|
[154, 466]])], 'rec_boxes': array([], dtype=float64)}]}}
|
|
|
```
|
|
```
|
|
|
|
|
|
|
@@ -718,7 +514,7 @@ The visualized results are saved under `save_path`, and the visualized result of
|
|
|
|
|
|
|
|
<img src="https://raw.githubusercontent.com/cuicheng01/PaddleX_doc_images/main/images/pipelines/seal_recognition/03.png"/>
|
|
<img src="https://raw.githubusercontent.com/cuicheng01/PaddleX_doc_images/main/images/pipelines/seal_recognition/03.png"/>
|
|
|
|
|
|
|
|
-### 2.1.2 Python Script Integration
|
|
|
|
|
|
|
+#### 2.2.2 Python Script Integration
|
|
|
|
|
|
|
|
* The above command line is for quickly experiencing and viewing the effect. Generally, in a project, you often need to integrate through code. You can complete the quick inference of the pipeline with just a few lines of code. The inference code is as follows:
|
|
* The above command line is for quickly experiencing and viewing the effect. Generally, in a project, you often need to integrate through code. You can complete the quick inference of the pipeline with just a few lines of code. The inference code is as follows:
|
|
|
|
|
|
|
@@ -733,9 +529,9 @@ output = pipeline.predict(
|
|
|
use_doc_unwarping=False,
|
|
use_doc_unwarping=False,
|
|
|
)
|
|
)
|
|
|
for res in output:
|
|
for res in output:
|
|
|
- res.print()
|
|
|
|
|
- res.save_to_img("./output/")
|
|
|
|
|
- res.save_to_json("./output/")
|
|
|
|
|
|
|
+ res.print()
|
|
|
|
|
+ res.save_to_img("./output/")
|
|
|
|
|
+ res.save_to_json("./output/")
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
In the above Python script, the following steps were executed:
|
|
In the above Python script, the following steps were executed:
|