|
|
@@ -187,6 +187,15 @@ def _apply_debug_overrides_to_config(
|
|
|
config['layout_detection']['debug_options'] = {}
|
|
|
config['layout_detection']['debug_options']['enabled'] = True
|
|
|
logger.info("✅ 启用布局检测 debug 输出")
|
|
|
+
|
|
|
+ # 1b. 水印去除 debug(页级预处理,与 layout 同属页面级可视化)
|
|
|
+ if enable_layout_debug:
|
|
|
+ preprocessor_cfg = config.setdefault('preprocessor', {})
|
|
|
+ wm_cfg = preprocessor_cfg.setdefault('watermark_removal', {})
|
|
|
+ if 'debug_options' not in wm_cfg:
|
|
|
+ wm_cfg['debug_options'] = {}
|
|
|
+ wm_cfg['debug_options']['enabled'] = True
|
|
|
+ logger.info("✅ 启用水印去除 debug 输出")
|
|
|
|
|
|
# 2. 表格分类 debug
|
|
|
if enable_table_debug:
|
|
|
@@ -212,13 +221,14 @@ def _apply_debug_overrides_to_config(
|
|
|
config['ocr_recognition']['debug_options']['enabled'] = True
|
|
|
logger.info("✅ 启用 OCR 识别 debug 输出")
|
|
|
|
|
|
- # 5. 更新输出配置
|
|
|
+ # 5. 更新输出配置(模块 debug 与审计图解耦;仅 --debug 全局模式默认打开审计图)
|
|
|
if enable_layout_debug or enable_ocr_debug or enable_table_debug:
|
|
|
- output_config = config.get('output', {})
|
|
|
+ output_config = config.setdefault('output', {})
|
|
|
output_config['debug_mode'] = True
|
|
|
- if enable_layout_debug or enable_ocr_debug:
|
|
|
- output_config.setdefault('save_layout_image', True)
|
|
|
- output_config.setdefault('save_ocr_image', True)
|
|
|
+ if debug:
|
|
|
+ output_config = config.setdefault('output', {})
|
|
|
+ output_config.setdefault('save_layout_image', True)
|
|
|
+ output_config.setdefault('save_ocr_image', True)
|
|
|
|
|
|
# 输出当前 debug 状态
|
|
|
if debug:
|
|
|
@@ -644,8 +654,8 @@ if __name__ == "__main__":
|
|
|
# "config": "./config/bank_statement_paddle_vl_local.yaml",
|
|
|
# "log_file": "./output/logs/bank_statement_paddle_vl_local/process.log",
|
|
|
|
|
|
- "input": "/Users/zhch158/workspace/data/流水分析/陈3_微信图.pdf",
|
|
|
- "output_dir": "/Users/zhch158/workspace/data/流水分析/陈3_微信图/bank_statement_yusys_local",
|
|
|
+ "input": "/Users/zhch158/workspace/data/流水分析/彭_广东兴宁农村商业银行.pdf",
|
|
|
+ "output_dir": "/Users/zhch158/workspace/data/流水分析/彭_广东兴宁农村商业银行/bank_statement_yusys_local",
|
|
|
"config": "./config/bank_statement_yusys_local.yaml",
|
|
|
"log_file": "./output/logs/bank_statement_yusys_local/process.log",
|
|
|
|
|
|
@@ -662,7 +672,7 @@ if __name__ == "__main__":
|
|
|
# "scene": "financial_report",
|
|
|
|
|
|
# 页面范围(可选)
|
|
|
- "pages": "3", # 只处理前1页
|
|
|
+ "pages": "2", # 只处理前1页
|
|
|
# "pages": "1-3,5,7-10", # 处理指定页面
|
|
|
# "pages": "83-109", # 处理指定页面
|
|
|
|