Browse Source

feat(新增印章补充检测功能): 在bank_statement_paddle_vl_local.yaml中新增印章补充检测配置,优化密封区域识别能力,提升文档解析的准确性与完整性。同时更新表格识别配置,调整PaddleOCR-VL模型版本至1.6,增强整体OCR性能。

zhch158_admin 1 tháng trước cách đây
mục cha
commit
beb41fe75e

+ 18 - 3
ocr_tools/universal_doc_parser/config/bank_statement_paddle_vl_local.yaml

@@ -82,6 +82,22 @@ layout_detection:
     min_text_width_ratio: 0.4         # 最小宽度占比(40%)
     min_text_height_ratio: 0.3        # 最小高度占比(30%)
 
+  # 印章补充检测:使用 PP-DocLayoutV3 补充 docling 无法识别的密封区域
+  seal_supplement:
+    enabled: true                # 启用 seal 补充检测
+    replace_existing: false      # false=增量合并; true=完全替换主结果中已有 seal
+    replace_overlapping_image: true   # seal 与 image_body/image 等高 IoU 时替换为 seal(非丢弃)
+    replace_iou_threshold: 0.7        # 触发替换的最小 IoU
+    duplicate_iou_threshold: 0.3      # 未替换时,与任意框 IoU 超此值视为重复 seal
+    # seal_detector 使用的模型配置,默认复用 paddle_ppdoclayoutv3 的配置
+    model_config:
+      module: "paddle"
+      model_name: "PP-DocLayoutV3"
+      model_dir: "PaddlePaddle/PP-DocLayoutV3_safetensors"
+      device: "cpu"
+      conf: 0.3
+      num_threads: 4
+
   # Debug 可视化(底图为 inference_image,与 Layout 检测输入一致)
   debug_options:
     enabled: false              # 由命令行 --debug / --debug-layout 控制
@@ -105,7 +121,6 @@ ocr_recognition:
   batch_size: 8
   device: "cpu"
 
-
   # Debug 可视化(底图为 inference_image,与整页 OCR 输入一致)
   debug_options:
     enabled: false              # 由命令行 --debug / --debug-ocr 控制
@@ -137,7 +152,7 @@ table_classification:
 # 有线表格识别专用配置(MinerU UNet)
 # ============================================================
 table_recognition_wired:
-  use_wired_unet: true
+  use_wired_unet: false
   upscale_ratio: 3.333
   need_ocr: true
   row_threshold: 10
@@ -212,7 +227,7 @@ table_recognition_wired:
 vl_recognition:
   module: "paddle"
   backend: "http-client"
-  model_name: "PaddleOCR-VL-1.5"  # 与 paddle_local_daemon.sh 中 MODEL_NAME 一致
+  model_name: "PaddleOCR-VL-1.6"  # 与 paddle_local_daemon.sh 中 MODEL_NAME 一致
   server_url: "http://localhost:8102"
   max_image_size: 4096  # 🔧 添加:最大图片尺寸
   resize_mode: 'max'    # 🔧 添加:缩放模式 ('max' 保持宽高比, 'fixed' 固定尺寸)