|
|
@@ -3,8 +3,8 @@ scene_name: "bank_statement"
|
|
|
description: "银行交易流水、对账单等场景"
|
|
|
|
|
|
input:
|
|
|
- supported_formats: [".pdf", ".png", ".jpg"]
|
|
|
- dpi: 200
|
|
|
+ supported_formats: [".pdf", ".png", ".jpg", ".jpeg", ".bmp", ".tiff"]
|
|
|
+ dpi: 200 # PDF转图片的DPI
|
|
|
|
|
|
preprocessor:
|
|
|
module: "mineru"
|
|
|
@@ -19,19 +19,39 @@ layout_detection:
|
|
|
# module: "paddle"
|
|
|
# model_name: "RT-DETR-H_layout_17cls"
|
|
|
# model_dir: /Users/zhch158/workspace/repository.git/PaddleX/zhch/unified_pytorch_models/Layout/RT-DETR-H_layout_17cls.onnx # 使用默认路径,或指定: "./Layout/RT-DETR-H_layout_17cls.onnx"
|
|
|
- module: "mineru"
|
|
|
- model_name: "layout"
|
|
|
- model_dir: null # 使用默认路径
|
|
|
- device: "cpu"
|
|
|
# batch_size: 4
|
|
|
# conf: 0.1
|
|
|
# iou: 0.45
|
|
|
+ module: "docling"
|
|
|
+ model_name: "docling-layout-old"
|
|
|
+ model_dir: ds4sd/docling-layout-old
|
|
|
+ device: "cpu"
|
|
|
+ conf: 0.3
|
|
|
+ num_threads: 4
|
|
|
+
|
|
|
+ # 后处理配置
|
|
|
+ post_process:
|
|
|
+ # 将大面积文本块转换为表格(后处理)
|
|
|
+ convert_large_text_to_table: true # 是否启用
|
|
|
+ min_text_area_ratio: 0.25 # 最小面积占比(25%)
|
|
|
+ min_text_width_ratio: 0.4 # 最小宽度占比(40%)
|
|
|
+ min_text_height_ratio: 0.3 # 最小高度占比(30%)
|
|
|
|
|
|
+ # Debug 可视化配置(与 MinerUWiredTableRecognizer.DebugOptions 对齐)
|
|
|
+ # 默认关闭。开启后将保存:layout检测结果
|
|
|
+ debug_options:
|
|
|
+ enabled: true # 是否开启调试可视化输出
|
|
|
+ output_dir: null # 调试输出目录;null不输出
|
|
|
+ prefix: "" # 保存文件名前缀(如设置为页码)
|
|
|
+
|
|
|
+# ============================================================
|
|
|
+# VL识别配置(表格、公式)
|
|
|
+# ============================================================
|
|
|
vl_recognition:
|
|
|
module: "paddle"
|
|
|
backend: "http-client"
|
|
|
model_name: "PaddleOCR-VL-0.9B"
|
|
|
- server_url: "http://10.192.72.11:8110"
|
|
|
+ server_url: "http://10.192.72.11:20016"
|
|
|
max_image_size: 4096 # 🔧 添加:最大图片尺寸
|
|
|
resize_mode: 'max' # 🔧 添加:缩放模式 ('max' 保持宽高比, 'fixed' 固定尺寸)
|
|
|
device: "cpu"
|
|
|
@@ -48,39 +68,27 @@ vl_recognition:
|
|
|
ocr_recognition:
|
|
|
module: "mineru"
|
|
|
language: "ch"
|
|
|
- det_threshold: 0.3
|
|
|
- unclip_ratio: 1.8
|
|
|
+ det_threshold: 0.6
|
|
|
+ unclip_ratio: 1.5
|
|
|
+ enable_merge_det_boxes: false
|
|
|
batch_size: 8
|
|
|
device: "cpu"
|
|
|
|
|
|
+# ============================================================
|
|
|
+# 输出配置
|
|
|
+# ============================================================
|
|
|
output:
|
|
|
+ create_subdir: false
|
|
|
+ save_pdf_images: true
|
|
|
save_json: true
|
|
|
+ save_page_json: true
|
|
|
save_markdown: true
|
|
|
+ save_page_markdown: true
|
|
|
save_html: true
|
|
|
save_layout_image: true
|
|
|
save_ocr_image: true
|
|
|
draw_type_label: true
|
|
|
draw_bbox_number: true
|
|
|
-
|
|
|
-# 场景特定配置
|
|
|
-scene_config:
|
|
|
- bank_statement:
|
|
|
- table_structure: "single_column_list"
|
|
|
- merged_cells: false
|
|
|
- expected_columns: ["日期", "摘要", "收入", "支出", "余额"]
|
|
|
- amount_validation: true
|
|
|
- date_validation: true
|
|
|
-
|
|
|
- processing_rules:
|
|
|
- # 表格处理规则
|
|
|
- table_rules:
|
|
|
- - detect_table_type: ["wired", "wireless"]
|
|
|
- - extract_header_automatically: true
|
|
|
- - validate_amount_format: true
|
|
|
- - merge_continuation_rows: true
|
|
|
-
|
|
|
- # OCR后处理规则
|
|
|
- ocr_rules:
|
|
|
- - filter_low_confidence: 0.7
|
|
|
- - merge_adjacent_text: true
|
|
|
- - number_format_normalization: true
|
|
|
+ save_enhanced_json: true
|
|
|
+ normalize_numbers: true
|
|
|
+ debug_mode: true
|