浏览代码

feat: 修改表格处理管线,关闭单元格内拆分以保留折行文本

zhch158_admin 1 月之前
父节点
当前提交
e2bcf0dd7d
共有 1 个文件被更改,包括 9 次插入2 次删除
  1. 9 2
      zhch/table_recognition_v2_single_process.py

+ 9 - 2
zhch/table_recognition_v2_single_process.py

@@ -125,9 +125,16 @@ def process_images_with_table_pipeline(
             try:
                 outputs = pipeline.predict(
                     img_path,
-                    use_doc_preprocessor=True,
+                    use_doc_orientation_classify=False,
+                    use_doc_unwarping=False,
                     use_layout_detection=True,
-                    use_ocr_model=True
+                    use_ocr_results_with_table_cells=True,
+                    use_table_orientation_classify=False,
+                    use_wired_table_cells_trans_to_html=True,
+                    # 新增:关闭单元格内拆分,整格识别以保留折行文本, 
+                    # 修改paddlex/inference/pipelines/table_recognition/pipeline_v2.py
+                    # get_table_recognition_res传入参数self.cells_split_ocr=False,保证单元格内换行不被拆分
+                    use_table_cells_split_ocr=False,
                 )
                 cost = time.time() - start