Эх сурвалжийг харах

[Docs] refine table related docs (#4027)

* Update paddlepaddle_install.md

* Update paddlepaddle_install_en.md

* table_pipe_v2 for pdx3.0

* Fix bug

---------

Co-authored-by: Bobholamovic <bob1998425@hotmail.com>
Liu Jiaxuan 6 сар өмнө
parent
commit
19d177135d

+ 1 - 1
docs/module_usage/tutorials/ocr_modules/table_classification.en.md

@@ -18,7 +18,7 @@ The table classification module is a key component of a computer vision system,
 <th>Model Storage Size (M)</th>
 </tr>
 <tr>
-<td>PP-LCNet_x1_0_table_cls</td><td><a href="https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/CLIP_vit_base_patch16_224_infer.tar">Inference Model</a>/<a href="https://paddle-model-ecology.bj.bcebos.com/paddlex/official_pretrained_model/PP-LCNet_x1_0_table_cls_pretrained.pdparams">Training Model</a></td>
+<td>PP-LCNet_x1_0_table_cls</td><td><a href="https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-LCNet_x1_0_table_cls_infer.tar">Inference Model</a>/<a href="https://paddle-model-ecology.bj.bcebos.com/paddlex/official_pretrained_model/PP-LCNet_x1_0_table_cls_pretrained.pdparams">Training Model</a></td>
 <td>94.2</td>
 <td>2.35 / 0.47</td>
 <td>4.03 / 1.35</td>

+ 1 - 1
docs/module_usage/tutorials/ocr_modules/table_classification.md

@@ -19,7 +19,7 @@ comments: true
 <th>模型存储大小 (M)</th>
 </tr>
 <tr>
-<td>PP-LCNet_x1_0_table_cls</td><td><a href="https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/CLIP_vit_base_patch16_224_infer.tar">推理模型</a>/<a href="https://paddle-model-ecology.bj.bcebos.com/paddlex/official_pretrained_model/PP-LCNet_x1_0_table_cls_pretrained.pdparams">训练模型</a></td>
+<td>PP-LCNet_x1_0_table_cls</td><td><a href="https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-LCNet_x1_0_table_cls_infer.tar">推理模型</a>/<a href="https://paddle-model-ecology.bj.bcebos.com/paddlex/official_pretrained_model/PP-LCNet_x1_0_table_cls_pretrained.pdparams">训练模型</a></td>
 <td>94.2</td>
 <td>2.35 / 0.47</td>
 <td>4.03 / 1.35</td>

+ 28 - 3
docs/pipeline_usage/tutorials/ocr_pipelines/table_recognition_v2.en.md

@@ -928,13 +928,13 @@ In the above Python script, the following steps are executed:
 </td>
 <td><code>None</code></td>
 </tr>
-<td><code>use_table_cells_ocr_results</code></td>
-<td>Whether to enable Table-Cells-OCR mode, when not enabled, use global OCR result to fill to HTML table, when enabled, do OCR cell by cell and fill to HTML table (it will increase the time consuming). Both of them perform differently in different scenarios, please choose according to the actual situation.</td>
+<td><code>use_ocr_results_with_table_cells</code></td>
+<td>Whether to enable cell OCR mode, when not enabled, the global OCR results are used to populate the HTML table, when enabled, based on the cell prediction results, the global OCR results are sliced and re-recognized based on the cell, to avoid the situation that the text is connected across the cell or missing. This mode will slightly increase the inference time consuming, and the effect may be different in different scenarios, please choose according to the actual situation.</td>
 <td><code>bool</code></td>
 <td>
 <ul>
 <li><b>bool</b>:<code>True</code> or <code>False</code>
-<td><code>False</code></td>
+<td><code>True</code></td>
 </tr>
 <td><code>use_e2e_wired_table_rec_model</code></td>
 <td>Whether to enable the wired table end-to-end prediction mode, when not enabled, using the table cells detection model prediction results filled to the HTML table, when enabled, using the end-to-end table structure recognition model cell prediction results filled to the HTML table. Both of them have different performance in different scenarios, please choose according to the actual situation.</td>
@@ -951,6 +951,31 @@ In the above Python script, the following steps are executed:
 <ul>
 <li><b>bool</b>:<code>True</code> or <code>False</code>
 <td><code>False</code></td>
+</tr>
+<td><code>use_table_orientation_classify</code></td>
+<td>Whether to enable the table orientation classification mode, when it is not enabled, the table will be recognized directly based on the incoming image, when it is enabled, it will detect whether the table in the image is rotated or not, and be able to correct the orientation of the table by 90/180/270 degrees before recognizing the table. This mode will slightly increase the inference time, please choose according to the actual situation.</td>
+<td><code>bool</code></td>
+<td>
+<ul>
+<li><b>bool</b>:<code>True</code> or <code>False</code>
+<td><code>True</code></td>
+</tr>
+<td><code>use_wired_table_cells_trans_to_html</code></td>
+<td>Whether to enable the wired table cell direct to HTML mode, when it is not enabled, the HTML structure of the table is normally predicted by the table structure recognition module, when it is enabled, the HTML structure is constructed directly based on the positional arrangement and geometric relationship of the cells predicted by the wired table cell detection model. The effect of this model is different in different scenarios, please choose according to the actual situation. Generally speaking, it is recommended to enable this mode in scenarios where the wired table cell detection is very accurate, in order to obtain more accurate end-to-end table recognition results.</td>
+<td><code>bool</code></td>
+<td>
+<ul>
+<li><b>bool</b>:<code>True</code> or <code>False</code>
+<td><code>False</code></td>
+</tr>
+<td><code>use_wireless_table_cells_trans_to_html</code></td>
+<td>Whether to enable the wireless table cell direct to HTML mode, when it is not enabled, the HTML structure of the table is normally predicted by the table structure recognition module, when it is enabled, the HTML structure is constructed directly based on the positional arrangement and geometrical relationship of the cells predicted by the wireless table cell detection model. The effect of this model is different in different scenarios, please choose according to the actual situation. Generally speaking, it is recommended to enable this mode in scenarios where the wireless table cell detection is very accurate, in order to obtain more accurate end-to-end table recognition results.</td>
+<td><code>bool</code></td>
+<td>
+<ul>
+<li><b>bool</b>:<code>True</code> or <code>False</code>
+<td><code>False</code></td>
+</tr>
 </table>
 
 <b>If you need to use the end-to-end table structure recognition model, just replace the corresponding table structure recognition model with the end-to-end table structure recognition model in the pipeline config file, and then load the modified config file and modify the corresponding `predict()` method parameter</b>. For example, if you need to use SLANet_plus to do end-to-end table recognition for wireless tables, just replace `model_name` with SLANet_plus in `WirelessTableStructureRecognition` in the config file (as shown below) and specify `use_e2e_ wireless_table_rec_model=True` in the prediction, the rest of the parts do not need to be modified, at this time the wireless table cells detection model will not take effect, but directly use SLANet_plus for end-to-end table recognition.

+ 31 - 7
docs/pipeline_usage/tutorials/ocr_pipelines/table_recognition_v2.md

@@ -933,16 +933,16 @@ for res in output:
     <li><b>None</b>:如果设置为 <code>None</code>, 将默认使用产线初始化的该参数值 <code>0.0</code>。即不设阈值</li></li></ul></td>
 <td><code>None</code></td>
 </tr>
-<td><code>use_table_cells_ocr_results</code></td>
-<td>是否启用单元格OCR模式,不启用时采用全局OCR结果填充至HTML表格,启用时逐个单元格做OCR并填充至HTML表格(会增加耗时)。二者在不同场景下性能不同,请根据实际情况选择。</td>
+<td><code>use_ocr_results_with_table_cells</code></td>
+<td>是否启用单元格OCR模式,不启用时采用全局OCR结果填充至HTML表格,启用时基于单元格预测结果,对全局OCR结果基于单元格进行切分和重识别,避免出现文字跨单元格连接或缺失的情况。此模式会略微增加推理耗时,并且在不同场景下效果可能不同,请根据实际情况选择。</td>
 <td><code>bool</code></td>
 <td>
 <ul>
 <li><b>bool</b>:<code>True</code> 或者 <code>False</code>
-<td><code>False</code></td>
+<td><code>True</code></td>
 </tr>
 <td><code>use_e2e_wired_table_rec_model</code></td>
-<td>是否启用有线表格端到端预测模式,不启用时采用表格单元格检测模型预测结果填充至HTML表格,启用时采用端到端表格结构识别模型的单元格预测结果填充至HTML表格。二者在不同场景下性能不同,请根据实际情况选择。</td>
+<td>是否启用有线表格端到端预测模式,不启用时采用表格单元格检测模型预测结果填充至HTML表格,启用时采用端到端表格结构识别模型的单元格预测结果填充至HTML表格。二者在不同场景下效果不同,请根据实际情况选择。</td>
 <td><code>bool</code></td>
 <td>
 <ul>
@@ -950,14 +950,38 @@ for res in output:
 <td><code>False</code></td>
 </tr>
 <td><code>use_e2e_wireless_table_rec_model</code></td>
-<td>是否启用无线表格端到端预测模式,不启用时采用表格单元格检测模型预测结果填充至HTML表格,启用时采用端到端表格结构识别模型的单元格预测结果填充至HTML表格。二者在不同场景下性能不同,请根据实际情况选择。</td>
+<td>是否启用无线表格端到端预测模式,不启用时采用表格单元格检测模型预测结果填充至HTML表格,启用时采用端到端表格结构识别模型的单元格预测结果填充至HTML表格。二者在不同场景下效果不同,请根据实际情况选择。</td>
 <td><code>bool</code></td>
 <td>
 <ul>
 <li><b>bool</b>:<code>True</code> 或者 <code>False</code>
 <td><code>False</code></td>
-
-</tr></table>
+</tr>
+<td><code>use_table_orientation_classify</code></td>
+<td>是否启用表格方向分类模式,不启用时直接基于传入图像进行表格识别,启用时会检测图像中的表格是否存在旋转,能够将表格方向进行90/180/270度的方向校正后再进行表格识别。此模式会略微增加推理耗时,请根据实际情况选择。</td>
+<td><code>bool</code></td>
+<td>
+<ul>
+<li><b>bool</b>:<code>True</code> 或者 <code>False</code>
+<td><code>True</code></td>
+</tr>
+<td><code>use_wired_table_cells_trans_to_html</code></td>
+<td>是否启用有线表单元格直转HTML模式,不启用时正常通过表格结构识别模块预测得到表格的HTML结构,启用时直接基于有线表单元格检测模型预测的各单元格位置排布与几何关系构建HTML结构。此模式在不同场景下效果不同,请根据实际情况选择。一般来说,建议在有线表单元格检测非常准确的场景下开启此模式,以获得更加准确的端到端表格识别结果。</td>
+<td><code>bool</code></td>
+<td>
+<ul>
+<li><b>bool</b>:<code>True</code> 或者 <code>False</code>
+<td><code>False</code></td>
+</tr>
+<td><code>use_wireless_table_cells_trans_to_html</code></td>
+<td>是否启用无线表单元格直转HTML模式,不启用时正常通过表格结构识别模块预测得到表格的HTML结构,启用时直接基于无线表单元格检测模型预测的各单元格位置排布与几何关系构建HTML结构。此模式在不同场景下效果不同,请根据实际情况选择。一般来说,建议在无线表单元格检测非常准确的场景下开启此模式,以获得更加准确的端到端表格识别结果。</td>
+<td><code>bool</code></td>
+<td>
+<ul>
+<li><b>bool</b>:<code>True</code> 或者 <code>False</code>
+<td><code>False</code></td>
+</tr>
+</table>
 
 <b>如果您需要使用端到端表格结构识别模型,只需在产线配置文件中将对应的表格结构识别模型替换为端到端表格结构识别模型,然后直接加载修改后的配置文件并修改对应的`predict()` 方法参数即可</b>。例如,如果您需要使用 SLANet_plus 对无线表格做端到端表格识别,只需将配置文件中 `WirelessTableStructureRecognition` 中的 `model_name` 替换为 SLANet_plus(如下所示),并在预测时指定 `use_e2e_wireless_table_rec_model=True` 即可,其余部分无需修改,此时无线表单元格检测模型将不会生效,而是直接使用 SLANet_plus 进行端到端表格识别。
 

+ 1 - 1
docs/support_list/models_list.md

@@ -2442,7 +2442,7 @@ devanagari_PP-OCRv3_mobile_rec_infer.tar">推理模型</a>/<a href="">训练模
 <td>4.03 / 1.35</td>
 <td>6.6M</td>
 <td><a href="https://github.com/PaddlePaddle/PaddleX/blob/develop/paddlex/configs/modules/table_classification/PP-LCNet_x1_0_table_cls.yaml">PP-LCNet_x1_0_table_cls.yaml</a></td>
-<td><a href="https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/CLIP_vit_base_patch16_224_infer.tar">推理模型</a>/<a href="https://paddle-model-ecology.bj.bcebos.com/paddlex/official_pretrained_model/PP-LCNet_x1_0_table_cls_pretrained.pdparams">训练模型</a></td>
+<td><a href="https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-LCNet_x1_0_table_cls_infer.tar">推理模型</a>/<a href="https://paddle-model-ecology.bj.bcebos.com/paddlex/official_pretrained_model/PP-LCNet_x1_0_table_cls_pretrained.pdparams">训练模型</a></td>
 </tr>
 </table>
 <p><b>注:以上精度指标测量自 PaddleX 内部自建表格分类数据集。</b></p>