Răsfoiți Sursa

update doc and config of PP-StructureV3 (#3635)

changdazhou 8 luni în urmă
părinte
comite
ca693f4dd0

+ 8 - 0
docs/pipeline_usage/tutorials/ocr_pipelines/PP-StructureV3.en.md

@@ -717,6 +717,14 @@ for item in markdown_images:
             image.save(file_path)
             image.save(file_path)
 ```
 ```
 
 
+**Note:**
+
+(1) The default text recognition model used by PP-StructureV3 is the **Chinese recognition model**. There is a certain probability of errors when recognizing some English text. You can refer to the model list to switch to an English recognition model.
+
+(2) In the example code, the parameters `use_doc_orientation_classify`, `use_doc_unwarping`, and `use_textline_orientation` are all set to False. This means that document orientation classification, document unwarping, and text line orientation classification are disabled. If you need to use these features, you can set them to True.
+
+(3) PP-StructureV3 provides flexible parameter configuration, allowing you to adjust parameters for layout detection, text detection, text recognition, etc., based on the characteristics of the document for better results. For more detailed configurations, please refer to the [PP-StructureV3 configuration file](../../../../paddlex/configs/pipelines/PP-StructureV3.yaml).
+
 In the above Python script, the following steps are executed:
 In the above Python script, the following steps are executed:
 
 
 (1) Instantiate the `create_pipeline` instance to create a pipeline object. The specific parameter descriptions are as follows:
 (1) Instantiate the `create_pipeline` instance to create a pipeline object. The specific parameter descriptions are as follows:

+ 8 - 1
docs/pipeline_usage/tutorials/ocr_pipelines/PP-StructureV3.md

@@ -5,7 +5,7 @@ comments: true
 # 通用版面解析v3产线使用教程
 # 通用版面解析v3产线使用教程
 
 
 ## 1. 通用版面解析v3产线介绍
 ## 1. 通用版面解析v3产线介绍
-版面解析是一种从文档图像中提取结构化信息的技术,主要用于将复杂的文档版面转换为机器可读的数据格式。这项技术在文档管理、信息提取和数据数字化等领域具有广泛的应用。版面解析通过结合光学字符识别(OCR)、图像处理和机器学习算法,能够识别和提取文档中的文本块、标题、段落、图片、表格以及其他版面元素。此过程通常包括版面分析、元素分析和数据格式化三个主要步骤,最终生成结构化的文档数据,提升数据处理的效率和准确性。<b>通用版面解析v3产线在通用版面解析v1产线的基础上,强化了版面区域检测、表格识别、公式识别的能力,增加了多栏阅读顺序的恢复能力、结果转换 Markdown 文件的能力,在多种文档数据中,表现优异,可以处理较复杂的文档数据。</b>本产线同时提供了灵活的服务化部署方式,支持在多种硬件上使用多种编程语言调用。不仅如此,本产线也提供了二次开发的能力,您可以基于本产线在您自己的数据集上训练调优,训练后的模型也可以无缝集成。
+版面解析是一种从文档图像中提取结构化信息的技术,主要用于将复杂的文档版面转换为机器可读的数据格式。这项技术在文档管理、信息提取和数据数字化等领域具有广泛的应用。版面解析通过结合光学字符识别(OCR)、图像处理和机器学习算法,能够识别和提取文档中的文本块、标题、段落、图片、表格以及其他版面元素。此过程通常包括版面分析、元素分析和数据格式化三个主要步骤,最终生成结构化的文档数据,提升数据处理的效率和准确性。<b>通用版面解析v3(PP-StructureV3)产线在通用版面解析v1产线的基础上,强化了版面区域检测、表格识别、公式识别的能力,增加了多栏阅读顺序的恢复能力、结果转换 Markdown 文件的能力,在多种文档数据中,表现优异,可以处理较复杂的文档数据。</b>本产线同时提供了灵活的服务化部署方式,支持在多种硬件上使用多种编程语言调用。不仅如此,本产线也提供了二次开发的能力,您可以基于本产线在您自己的数据集上训练调优,训练后的模型也可以无缝集成。
 
 
 <b>通用版面解析v3产线中包含必选的版面区域分析模块、通用OCR子产线,</b>以及可选的文档图像预处理子产线、表格识别子产线、印章识别子产线和公式识别子产线。
 <b>通用版面解析v3产线中包含必选的版面区域分析模块、通用OCR子产线,</b>以及可选的文档图像预处理子产线、表格识别子产线、印章识别子产线和公式识别子产线。
 
 
@@ -667,6 +667,13 @@ for item in markdown_images:
             image.save(file_path)
             image.save(file_path)
 ```
 ```
 
 
+**注:**
+
+(1)PP-StructureV3 产线使用的默认文本识别模型为**中文识别模型**,对于部分英文文字存在一定概率识别错误,可以参考模型列表更换英文识别模型。
+
+(2)在示例代码中,`use_doc_orientation_classify`、`use_doc_unwarping`、`use_textline_orientation` 参数均设置为 False,分别表示关闭文档方向分类、文档去扭曲、文本行方向分类功能,如果需要使用这些功能,可以设置为 True。
+
+(3)PP-StructureV3 产线提供了灵活的参数配置,可以在使用过程中针对文档的特点灵活的调整版面检测、文本检测、文本识别等模块的参数,以获得更好的效果,更多详细配置可以参考[PP-StructureV3 配置文件](../../../../paddlex/configs/pipelines/PP-StructureV3.yaml)。
 
 
 在上述 Python 脚本中,执行了如下几个步骤:
 在上述 Python 脚本中,执行了如下几个步骤:
 <details><summary>(1)实例化 <code>create_pipeline</code> 实例化产线对象,具体参数说明如下:</summary>
 <details><summary>(1)实例化 <code>create_pipeline</code> 实例化产线对象,具体参数说明如下:</summary>

+ 44 - 1
paddlex/configs/pipelines/PP-StructureV3.yaml

@@ -14,14 +14,57 @@ SubModules:
     model_dir: null
     model_dir: null
     threshold: 
     threshold: 
       0: 0.3  # paragraph_title
       0: 0.3  # paragraph_title
+      1: 0.5  # image
+      2: 0.5  # text
+      3: 0.5  # number
+      4: 0.5  # abstract
+      5: 0.5  # content
+      6: 0.5  # figure_title
       7: 0.3  # formula
       7: 0.3  # formula
+      8: 0.5  # table
+      9: 0.5  # table_title
+      10: 0.5 # reference
+      11: 0.5 # doc_title
+      12: 0.5 # footnote
+      13: 0.5 # header
+      14: 0.5 # algorithm
+      15: 0.5 # footer
       16: 0.3 # seal
       16: 0.3 # seal
+      17: 0.5 # chart_title
+      18: 0.5 # chart
+      19: 0.5 # formula_number
+      20: 0.5 # header_image
+      21: 0.5 # footer_image
+      22: 0.5 # aside_text
     layout_nms: True
     layout_nms: True
     layout_unclip_ratio: 1.0
     layout_unclip_ratio: 1.0
+      2: 1.0 # text
+      7: 1.0 # formula
+      8: 1.0 # table
     layout_merge_bboxes_mode: 
     layout_merge_bboxes_mode: 
+      0: "union"  # paragraph_title
       1: "large"  # image
       1: "large"  # image
-      18: "large" # chart
+      2: "union"  # text
+      3: "union"  # number
+      4: "union"  # abstract
+      5: "union"  # content
+      6: "union"  # figure_title
       7: "large"  # formula
       7: "large"  # formula
+      8: "union"  # table
+      9: "union"  # table_title
+      10: "union" # reference
+      11: "union" # doc_title
+      12: "union" # footnote
+      13: "union" # header
+      14: "union" # algorithm
+      15: "union" # footer
+      16: "union" # seal
+      17: "union" # chart_title
+      18: "large" # chart
+      19: "union" # formula_number
+      20: "union" # header_image
+      21: "union" # footer_image
+      22: "union" # aside_text
 
 
 SubPipelines:
 SubPipelines:
   DocPreprocessor:
   DocPreprocessor: