|
|
@@ -124,11 +124,11 @@ def process_images_with_table_pipeline(
|
|
|
try:
|
|
|
outputs = pipeline.predict(
|
|
|
img_path,
|
|
|
- use_doc_orientation_classify=False,
|
|
|
+ use_doc_orientation_classify=True,
|
|
|
use_doc_unwarping=False,
|
|
|
use_layout_detection=True,
|
|
|
use_ocr_results_with_table_cells=True,
|
|
|
- use_table_orientation_classify=False,
|
|
|
+ use_table_orientation_classify=True,
|
|
|
use_wired_table_cells_trans_to_html=True,
|
|
|
# 新增:关闭单元格内拆分,整格识别以保留折行文本,
|
|
|
# 修改paddlex/inference/pipelines/table_recognition/pipeline_v2.py
|
|
|
@@ -299,11 +299,12 @@ if __name__ == "__main__":
|
|
|
# "--device": "cpu",
|
|
|
# }
|
|
|
demo = {
|
|
|
- "--input_file": "/Users/zhch158/workspace/data/至远彩色印刷工业有限公司/2023年度报告母公司.img/2023年度报告母公司_page_004.png",
|
|
|
+ "--input_file": "/Users/zhch158/workspace/data/至远彩色印刷工业有限公司/2023年度报告母公司.img/2023年度报告母公司_page_003.png",
|
|
|
"--output_dir": "/Users/zhch158/workspace/data/至远彩色印刷工业有限公司/table_recognition_v2_Results",
|
|
|
"--pipeline": "./my_config/table_recognition_v2.yaml",
|
|
|
"--device": "cpu",
|
|
|
}
|
|
|
+
|
|
|
sys.argv = [sys.argv[0]] + [kv for kv in sum(demo.items(), ())]
|
|
|
|
|
|
sys.exit(main())
|