2 Коміти 10dad08fb0 ... 2e8ed5fad9

Автор SHA1 Опис Дата
  zhch158_admin 2e8ed5fad9 fix(VLM服务地址): 修复ppstructure_v3重复条目,添加glm_vllm地址 6 днів тому
  zhch158_admin 3f3bde9d60 feat(universal_doc_parser): 增强模型选择与识别功能,支持GLM-OCR和多源单元格融合 6 днів тому

+ 2 - 0
docs/ocr_tools/universal_doc_parser/VLM服务地址.md

@@ -1,4 +1,6 @@
 mineru_vllm 10.192.72.11:20006
 paddleocr_vllm 10.192.72.11:20016
 ppstructure_v3 10.192.72.11:20026
+ppstructure_v3 10.192.72.11:20026
+glm_vllm 10.192.72.11:20036
 dots_vllm 10.192.72.11:8101

+ 317 - 47
docs/ocr_tools/universal_doc_parser/模型统一框架.md

@@ -7,10 +7,12 @@
 ### 1. 模块化与可替换性
 框架采用**模块化设计**,各处理节点可根据不同场景灵活替换:
 - **方向识别**:支持多种模型(PP-LCNet、PDF rotation等)
-- **Layout检测**:支持 Docling、MinerU、Paddle、DiT 等多种检测器
+- **Layout检测**:支持 Docling、MinerU、Paddle(PP-DocLayoutV3)、DiT 等多种检测器 ⭐
+  - **智能路由器**:支持多模型组合与自动选择(scene/ocr_eval/auto策略)⭐ 新增
 - **OCR识别**:支持 PaddleOCR
-- **表格识别**:支持 UNet(有线表格)、VLM(无线表格)等多种方案
-- **公式识别**:支持 MinerU VLM、PaddleOCR-VL 等
+- **表格识别**:支持 UNet(有线表格,带单元格融合)、VLM(无线表格)等多种方案 ⭐
+- **公式识别**:支持 MinerU VLM、GLM-OCR、PaddleOCR-VL 等 ⭐
+- **印章识别**:支持 GLM-OCR(专用seal任务提示词)⭐ 新增
 
 通过配置文件(YAML)即可切换不同的模型组合,无需修改代码。
 
@@ -40,11 +42,11 @@
 | 模型类型 | 推荐模型 | 说明 |
 |---------|---------|------|
 | **方向分类** | PP-LCNet_x1_0_doc_ori | paddle onnx格式的模型 |
-| **版式检测** | Docling Layout / DocLayout-YOLO | Docling 或 MinerU 模型 |
+| **版式检测** | Docling Layout / PP-DocLayoutV3 / DocLayout-YOLO | Docling、PaddleOCR-VL 或 MinerU 模型 ⭐ 增加PP-DocLayoutV3 |
 | **文字识别** | PaddleOCR (PyTorch) | 效果好,支持角度校正 |
 | **表格分类** | PaddleTableClsModel | 自动区分有线/无线表格 ⭐ 新增 |
-| **表格结构识别** | MinerU VLM / PaddleOCR-VL / UNET 有线表格 | VLM 返回 HTML 结构,UNet 返回单元格坐标 |
-| **公式识别** | MinerU VLM | 返回 LaTeX |
+| **表格结构识别** | MinerU VLM / GLM-OCR / PaddleOCR-VL / UNET 有线表格(支持单元格融合) | VLM 返回 HTML 结构,UNet 返回单元格坐标;UNet支持多源融合 ⭐ 增加GLM-OCR、单元格融合 |
+| **公式识别** | MinerU VLM / GLM-OCR | 返回 LaTeX ⭐ 增加GLM-OCR |
 | **单元格坐标匹配** | TableCellMatcher | OCR 检测框与 VLM 结构匹配 |
 
 ---
@@ -288,9 +290,17 @@ graph TB
         D1 --> D2{启用倾斜矫正?}
         D2 -->|是| D3[基于Mask检测倾斜角度<br/>Hough变换 + 矫正图片和OCR坐标]
         D2 -->|否| D4
-        D3 --> D4[网格恢复<br/>grid_recovery.py]
-        D4 --> D4a[连通域提取单元格<br/>OCR边缘补偿]
-        D4a --> D5[边缘过滤<br/>edge_margin=padding×upscale×1.2]
+        D3 --> D4[连通域提取单元格<br/>compute_cells_from_lines]
+        
+        D4 --> D4_note["内部流程:线段提取→边缘过滤<br/>→线段合并/延长→重绘Mask<br/>→连通域分析→贴边过滤"]
+        D4_note --> D4b{启用单元格融合? ⭐}
+        
+        D4b -->|是| D4c[RT-DETR 单元格检测<br/>paddle_wired_table_cells_detector]
+        D4c --> D4d[多源融合<br/>UNet + RT-DETR + OCR补偿]
+        D4d --> D5
+        D4b -->|否| D5
+        
+        D5[网格结构重建<br/>recover_grid_structure]
         D5 --> D6[文本填充<br/>text_filling.py]
         D6 --> D7[二次OCR修正<br/>单元格裁剪OCR]
         D7 --> D8[生成HTML<br/>data-bbox属性]
@@ -320,11 +330,14 @@ graph TB
     style D1 fill:#e1f5ff
     style D3 fill:#e1f5ff
     style D4 fill:#e1f5ff
-    style D4a fill:#e1f5ff
+    style D4_note fill:#ffe4b3
+    style D4b fill:#fff4e1
+    style D4c fill:#e1f5ff
+    style D4d fill:#e1f5ff
+    style D5 fill:#e1f5ff
     style D6 fill:#e1f5ff
     style D7 fill:#e1f5ff
     style D8 fill:#e1f5ff
-    style D5 fill:#ffe1e1
     style E1 fill:#e1f5ff
     style E2 fill:#e1f5ff
     style E3 fill:#fff4e1
@@ -396,6 +409,32 @@ graph TB
    - 合并距离过近的线条(`row_threshold`, `col_threshold`)
    - 生成单元格网格
 
+3.5. **🆕 多源单元格融合**(可选,`use_cell_fusion: true`)⭐ 新增:
+   - **RT-DETR 检测**:使用 `PaddleWiredTableCellsDetector` 端到端检测单元格
+   - **智能融合策略**(`cell_fusion.py`):
+     - **高IoU(>0.7)**:加权平均融合(UNet 60% + RT-DETR 40%)
+     - **低IoU**:保留两个单元格,后续NMS去重
+   - **OCR边缘补偿**:检测"有OCR文本但无单元格覆盖"的位置,生成补偿单元格
+   - **融合统计**:记录UNet数量、RT-DETR数量、融合数量、补偿数量等
+   - **自适应开关**:UNet检测为0时强制启用RT-DETR补救
+   - **边界噪声过滤**:过滤表格边界外的异常单元格
+   - **配置参数**:
+     ```yaml
+     cell_fusion:
+       rtdetr_model_path: "/path/to/RT-DETR-L_wired_table_cell_det.onnx"
+       unet_weight: 0.6           # UNet权重(结构性强)
+       rtdetr_weight: 0.4         # RT-DETR权重(鲁棒性强)
+       iou_merge_threshold: 0.7   # 高IoU合并阈值
+       iou_nms_threshold: 0.5     # NMS去重阈值
+       rtdetr_conf_threshold: 0.5 # RT-DETR置信度阈值
+       enable_ocr_compensation: true  # 启用OCR补偿
+     ```
+   - **优势**:
+     - ✅ 结合UNet结构性和RT-DETR鲁棒性
+     - ✅ 处理模糊表格线、断线、扭曲变形等情况
+     - ✅ 补偿单元格边界缺失,减少文本丢失
+     - ✅ 提高有线表格识别的鲁棒性和准确性
+
 4. **文本填充**(`text_filling.py`):
    - 计算OCR框与单元格的中心点匹配
    - 匹配OCR文本到对应单元格
@@ -672,8 +711,9 @@ ocr:
 
 | 配置文件 | det_threshold | unclip_ratio | enable_merge | 适用场景 | 说明 |
 |---------|--------------|--------------|--------------|---------|------|
-| bank_statement_yusys_v2.yaml | 0.6 | 1.5 | false | 银行流水(标准质量) | **推荐配置**,减少噪声框 |
-| bank_statement_mineru_v2.yaml | 0.6 | 1.5 | false | 财务报表(标准质量) | **推荐配置**,高精度 |
+| bank_statement_yusys_v4.yaml | 0.5 | 1.5 | false | 银行流水(智能路由+单元格融合)| **最新推荐**,平衡精度与召回 ⭐ |
+| bank_statement_yusys_v2.yaml | 0.6 | 1.5 | false | 银行流水(标准质量) | 推荐配置,减少噪声框 |
+| bank_statement_mineru_v2.yaml | 0.6 | 1.5 | false | 财务报表(标准质量) | 推荐配置,高精度 |
 | bank_statement_paddle_vl.yaml | 0.3 | 1.8 | false | 扫描质量差 | 宽松配置,增强召回 |
 | bank_statement_wired_unet.yaml | 0.5 | 1.8 | false | 有线表格 | 平衡配置,兼顾精度与召回 |
 
@@ -710,10 +750,14 @@ universal_doc_parser/
 ├── config/ # 配置文件
 │ ├── bank_statement_yusys_v2.yaml # 银行流水配置(Docling + PaddleOCR-VL)
+│ ├── bank_statement_yusys_v3.yaml # 银行流水配置(Docling + PaddleOCR-VL + 智能路由)
+│ ├── bank_statement_yusys_v4.yaml # 银行流水配置(智能路由 + GLM-OCR + 单元格融合)⭐ 新增
 │ ├── bank_statement_mineru_v2.yaml # 银行流水配置(MinerU layout + MinerU VLM)
 │ ├── bank_statement_mineru_vl.yaml # 银行流水配置(MinerU VLM)
 │ ├── bank_statement_paddle_vl.yaml # 银行流水配置(PaddleOCR-VL)
-│ └── bank_statement_wired_unet.yaml # 有线表格配置(Docling + UNET)⭐ 新增
+│ ├── bank_statement_glm_vl.yaml # 银行流水配置(GLM-OCR)⭐ 新增
+│ ├── bank_statement_wired_unet.yaml # 有线表格配置(Docling + UNET)⭐
+│ └── bank_statement_smart_router.yaml # 智能路由配置(多模型自动选择)⭐ 新增
 ├── core/ # 核心处理模块
 │ ├── pipeline_manager_v2.py # 主流水线管理器 ⭐
@@ -721,6 +765,9 @@ universal_doc_parser/
 │ ├── element_processors.py # 元素处理器(文本、表格、图片等)
 │ ├── coordinate_utils.py # 坐标转换工具
 │ ├── layout_utils.py # 布局处理工具(排序、去重、SpanMatcher)⭐
+│ ├── layout_model_router.py # 智能布局模型路由器 ⭐ 新增
+│ ├── ocr_based_layout_evaluator.py # OCR评估器(用于模型选择)⭐ 新增
+│ ├── table_coordinate_utils.py # 表格坐标工具
 │ ├── pdf_utils.py # PDF 处理工具
 │ ├── config_manager.py # 配置管理
 │ └── model_factory.py # 模型工厂
@@ -730,13 +777,16 @@ universal_doc_parser/
 │   ├── __init__.py
 │   ├── base.py # 适配器基类
 │   ├── mineru_adapter.py # MinerU 适配器
+│   ├── glmocr_vl_adapter.py # GLM-OCR VL适配器 ⭐ 新增
 │   ├── paddle_vl_adapter.py # PaddleOCR-VL 适配器
 │   ├── paddle_layout_detector.py # PaddleX RT-DETR 布局检测器
-│   ├── paddle_table_classifier.py # Paddle表格分类器 ⭐ 新增
+│   ├── pp_doclayout_v3_layout_adapter.py # PP-DocLayoutV3 布局检测器 ⭐ 新增
+│   ├── paddle_table_classifier.py # Paddle表格分类器 ⭐
+│   ├── paddle_wired_table_cells_detector.py # Paddle单元格检测器(RT-DETR)⭐ 新增
 │   ├── docling_layout_adapter.py # Docling 布局检测器 ⭐
-│   ├── dit_layout_adapter.py # DiT 布局检测器 ⭐ 新增
-│   ├── mineru_wired_table.py # MinerU 有线表格识别器 ⭐ 新增
-│   └── wired_table/ # 有线表格子模块 ⭐ 新增
+│   ├── dit_layout_adapter.py # DiT 布局检测器 ⭐
+│   ├── mineru_wired_table.py # MinerU 有线表格识别器 ⭐
+│   └── wired_table/ # 有线表格子模块 ⭐
 │     ├── __init__.py
 │     ├── debug_utils.py # 调试工具
 │     ├── ocr_formatter.py # OCR 格式转换
@@ -744,6 +794,7 @@ universal_doc_parser/
 │     ├── grid_recovery.py # 网格恢复
 │     ├── text_filling.py # 文本填充
 │     ├── html_generator.py # HTML 生成
+│     ├── cell_fusion_engine.py # 单元格融合引擎 ⭐ 新增
 │     └── visualization.py # 可视化
 ├── dit_support/ # DiT 布局检测器支持模块 ⭐
@@ -779,17 +830,25 @@ universal_doc_parser/
 ### 命令行
 
 ```bash
-# 处理单个 PDF 文件
-python main_v2.py -i document.pdf -c config/bank_statement_yusys_v2.yaml
+# 处理单个 PDF 文件(使用 v4 配置:智能路由 + GLM-OCR + 单元格融合)⭐ 推荐
+# ⚠️ 注意:--scene 参数是必需的
+python main_v2.py -i document.pdf -c config/bank_statement_yusys_v4.yaml --scene bank_statement
 
 # 处理图片目录
-python main_v2.py -i ./images/ -c config/bank_statement_yusys_v2.yaml
+python main_v2.py -i ./images/ -c config/bank_statement_yusys_v4.yaml --scene bank_statement
 
 # 开启 debug 模式(输出可视化图片)
-python main_v2.py -i doc.pdf -c config/bank_statement_yusys_v2.yaml --debug
+python main_v2.py -i doc.pdf -c config/bank_statement_yusys_v4.yaml --scene bank_statement --debug
 
 # 指定输出目录
-python main_v2.py -i doc.pdf -c config/bank_statement_yusys_v2.yaml -o ./my_output/
+python main_v2.py -i doc.pdf -c config/bank_statement_yusys_v4.yaml --scene bank_statement -o ./my_output/
+
+# 使用其他配置文件
+python main_v2.py -i doc.pdf -c config/bank_statement_yusys_v2.yaml --scene bank_statement  # Docling + PaddleOCR-VL
+python main_v2.py -i doc.pdf -c config/bank_statement_glm_vl.yaml --scene bank_statement    # GLM-OCR VLM
+
+# 财务报表场景
+python main_v2.py -i report.pdf -c config/bank_statement_yusys_v4.yaml --scene financial_report
 ```
 
 ### Python API
@@ -798,8 +857,8 @@ python main_v2.py -i doc.pdf -c config/bank_statement_yusys_v2.yaml -o ./my_outp
 from core.pipeline_manager_v2 import EnhancedDocPipeline
 from ocr_utils import OutputFormatterV2  # 从 ocr_utils 导入
 
-# 初始化流水线
-with EnhancedDocPipeline("config/bank_statement_yusys_v2.yaml") as pipeline:
+# 初始化流水线(使用 v4 配置)
+with EnhancedDocPipeline("config/bank_statement_yusys_v4.yaml") as pipeline:
     # 处理文档
     results = pipeline.process_document("document.pdf")
     
@@ -903,17 +962,59 @@ preprocessor:
   orientation_classifier:
     enabled: true  # 扫描件自动开启
 
-# 版式检测
+# ============================================================
+# Layout 检测配置 - 智能路由器(按场景直接选择模型)⭐ 新增
+# ============================================================
 layout_detection:
-  module: "docling"  # 可选: "mineru", "paddle", "docling"
-  model_name: "docling-layout-old"
-  model_dir: "ds4sd/docling-layout-old"  # HuggingFace 模型仓库
-  device: "cpu"
-  conf: 0.3
-
-# VL 识别(表格、公式)
+  module: "smart_router"  # 智能路由器,支持多模型策略
+  strategy: "scene"  # 可选: "ocr_eval", "auto", "scene"
+  
+  # 场景策略:按场景名称直接选择模型
+  scene_strategy:
+    bank_statement:
+      model: "docling"
+    financial_report:
+      model: "paddle_ppdoclayoutv3"
+  default_model: "docling"
+  
+  # 配置多个模型
+  models:
+    docling:
+      module: "docling"
+      model_name: "docling-layout-old"
+      model_dir: "ds4sd/docling-layout-old"
+      device: "cpu"
+      conf: 0.3
+    
+    paddle_ppdoclayoutv3:  # ⭐ 新增 PP-DocLayoutV3
+      module: "paddle"
+      model_name: "PP-DocLayoutV3"
+      model_dir: "PaddlePaddle/PP-DocLayoutV3_safetensors"
+      device: "cpu"
+      conf: 0.3
+      num_threads: 4
+      batch_size: 1
+  
+  # 后处理配置
+  post_process:
+    convert_large_text_to_table: true  # 将大面积文本块转换为表格
+    min_text_area_ratio: 0.25
+    min_text_width_ratio: 0.4
+    min_text_height_ratio: 0.3
+
+# VL 识别(表格、公式、印章)
 vl_recognition:
-  module: "paddle"  # 可选: "mineru", "paddle"
+  module: "glmocr"  # 可选: "mineru", "paddle", "glmocr" ⭐ 新增GLM-OCR
+  api_url: "http://10.192.72.11:20036/v1/chat/completions"  # GLM-OCR API地址
+  model: "glm-ocr"
+  max_image_size: 3500
+  
+  # Task prompt mapping - 针对不同任务使用不同提示词 ⭐
+  task_prompt_mapping:
+    text: "Text Recognition:"
+    table: "Table Recognition:"
+    formula: "Formula Recognition:"
+    seal: "Seal Recognition:"  # 印章识别 ⭐
   backend: "http-client"
   server_url: "http://xxx:8110"
   table_recognition:
@@ -937,6 +1038,26 @@ table_classification:
 # 有线表格识别配置
 table_recognition_wired:
   use_wired_unet: true        # 是否启用有线表格识别
+  
+  # 🆕 启用多源单元格融合 ⭐ 新增
+  use_cell_fusion: true
+  
+  # 融合引擎配置 ⭐
+  cell_fusion:
+    # RT-DETR 模型路径(必需)
+    rtdetr_model_path: "/path/to/RT-DETR-L_wired_table_cell_det.onnx"
+    
+    # 融合权重
+    unet_weight: 0.6        # UNet 权重(结构性强)
+    rtdetr_weight: 0.4      # RT-DETR 权重(鲁棒性强)
+    
+    # 阈值配置
+    iou_merge_threshold: 0.7    # 高IoU合并阈值
+    iou_nms_threshold: 0.5      # NMS去重阈值
+    rtdetr_conf_threshold: 0.5  # RT-DETR置信度阈值
+    
+    # 功能开关
+    enable_ocr_compensation: true  # 启用OCR边缘补偿
   upscale_ratio: 3.333        # 放大比例
   enable_deskew: true         # 是否启用倾斜矫正
   row_threshold: 10           # 行合并阈值(像素)
@@ -970,6 +1091,43 @@ output:
 
 支持多种布局检测模型,通过 `layout_detection.module` 配置切换:
 
+#### 0. 智能路由器(推荐)⭐ 新增
+
+支持多种策略自动选择或组合多个布局检测模型。
+
+```yaml
+layout_detection:
+  module: "smart_router"
+  strategy: "scene"  # 可选: "ocr_eval", "auto", "scene"
+  
+  # 场景策略:按场景名称直接选择模型
+  scene_strategy:
+    bank_statement:
+      model: "docling"
+    financial_report:
+      model: "paddle_ppdoclayoutv3"
+  default_model: "docling"
+  
+  # 配置多个模型
+  models:
+    docling:
+      module: "docling"
+      model_name: "docling-layout-old"
+      model_dir: "ds4sd/docling-layout-old"
+    
+    paddle_ppdoclayoutv3:
+      module: "paddle"
+      model_name: "PP-DocLayoutV3"
+      model_dir: "PaddlePaddle/PP-DocLayoutV3_safetensors"
+```
+
+**支持策略**:
+- `scene`:按场景名称直接选择模型(最快)
+- `ocr_eval`:运行所有模型,用OCR评估器选择最佳结果(最准确,需要OCR)
+- `auto`:基于文档特征自动选择(快速模式,无需OCR)
+
+**特点**:灵活组合多个模型,按场景或质量自动选择
+
 #### 1. Docling Layout (推荐)
 
 基于 HuggingFace transformers 的 RT-DETR 模型。
@@ -987,7 +1145,33 @@ layout_detection:
 - `ds4sd/docling-layout-egret-medium`
 - `ds4sd/docling-layout-egret-large`
 
-#### 2. PaddleX RT-DETR (ONNX)
+#### 2. PP-DocLayoutV3 (PaddleOCR-VL-1.5) ⭐ 新增
+
+基于 HuggingFace transformers 的 PP-DocLayoutV3 布局模型(PaddleOCR-VL-1.5版式分析模块)。
+
+```yaml
+layout_detection:
+  module: "paddle"
+  model_name: "PP-DocLayoutV3"
+  model_dir: "PaddlePaddle/PP-DocLayoutV3_safetensors"
+  device: "cpu"
+  conf: 0.3
+  num_threads: 4
+```
+
+**支持类别**(25类):
+- 文本类:abstract, algorithm, aside_text, content, text, paragraph_title, doc_title
+- 表格图表:table, chart, image
+- 公式:formula, formula_number
+- 元数据:header, footer, footnote, reference
+- 特殊:seal(印章)⭐
+
+**特点**:
+- 支持印章(seal)检测,可直接用于VLM识别
+- 基于 RT-DETR 架构,精度高
+- 来自 PaddleOCR-VL-1.5 官方发布
+
+#### 3. PaddleX RT-DETR (ONNX)
 
 基于 ONNX Runtime 的 PaddleX 布局检测器。
 
@@ -998,7 +1182,7 @@ layout_detection:
   model_dir: "/path/to/RT-DETR-H_layout_17cls.onnx"
 ```
 
-#### 3. MinerU DocLayout-YOLO
+#### 4. MinerU DocLayout-YOLO
 
 MinerU 内置的布局检测模型。
 
@@ -1008,7 +1192,7 @@ layout_detection:
   model_name: "layout"
 ```
 
-#### 4. DiT Layout (Document Image Transformer)
+#### 5. DiT Layout (Document Image Transformer)
 
 基于 Detectron2 的 DiT 模型,在 PubLayNet 数据集上训练。
 
@@ -1049,15 +1233,31 @@ layout_detection:
 通过 `table_recognition_wired.use_wired_unet` 配置:
 
 - **UNet 有线表格**:`use_wired_unet: true`(MinerU UNet模型)
+  - **单元格融合**:`use_cell_fusion: true`(融合UNet和RT-DETR结果)⭐ 新增
 
 #### 无线表格识别
 
 通过 `vl_recognition.module` 配置:
 
 - **MinerU VLM**:`module: "mineru"`
+- **GLM-OCR**:`module: "glmocr"`(直接HTTP调用,支持印章识别)⭐ 新增
 - **PaddleOCR-VL**:`module: "paddle"`(需配置服务地址)
 
-**后端支持**:
+**GLM-OCR配置示例**:
+```yaml
+vl_recognition:
+  module: "glmocr"
+  api_url: "http://10.192.72.11:20036/v1/chat/completions"
+  model: "glm-ocr"
+  max_image_size: 3500
+  task_prompt_mapping:
+    text: "Text Recognition:"
+    table: "Table Recognition:"
+    formula: "Formula Recognition:"
+    seal: "Seal Recognition:"  # 印章识别
+```
+
+**后端支持**(仅MinerU和PaddleOCR-VL):
 - `backend: "http-client"`:HTTP 客户端
 - `backend: "vllm-engine"`:vLLM 引擎
 - `backend: "transformers"`:Transformers 库
@@ -1069,6 +1269,7 @@ layout_detection:
 通过 `vl_recognition.module` 配置(与无线表格共享):
 
 - **MinerU VLM**:`module: "mineru"`
+- **GLM-OCR**:`module: "glmocr"`(直接HTTP调用)⭐ 新增
 - **PaddleOCR-VL**:`module: "paddle"`
 
 ---
@@ -1132,15 +1333,20 @@ OCR Span 与 Layout Block 匹配器,参考 MinerU 实现:
 - `process_code_element()` - 代码处理
 - `process_discard_element()` - 丢弃元素处理(支持 pre_matched_spans)
 
-### 3.1. PaddleTableClassifier (`paddle_table_classifier.py`) ⭐ 新增
+### 4. SmartLayoutRouter (`layout_model_router.py`) ⭐ 新增
 
-表格分类器,自动区分有线表格和无线表格:
-- `classify()` - 分类单个表格图像
-- `batch_classify()` - 批量分类表格图像
-- 使用 MinerU 的 `PaddleTableClsModel` 进行分类
-- 支持线条检测辅助判断(只有横线或竖线时强制判断为无线表格)
+智能布局模型路由器,支持多种策略:
+- **scene 策略**:按场景名称直接选择模型(最快,推荐用于生产环境)
+- **ocr_eval 策略**:运行所有模型,用OCR评估器选择最佳结果(最准确,需要OCR)
+- **auto 策略**:基于文档特征自动选择(快速模式,无需OCR)
+
+主要方法:
+- `detect()` - 执行布局检测,根据策略自动选择模型
+- `_scene_select_detect()` - 场景策略检测
+- `_ocr_eval_detect()` - OCR评估策略检测
+- `_auto_select_detect()` - 自动选择策略检测
 
-### 3.1. PaddleTableClassifier (`paddle_table_classifier.py`) ⭐ 新增
+### 5. PaddleTableClassifier (`paddle_table_classifier.py`) ⭐
 
 表格分类器,自动区分有线表格和无线表格:
 - `classify()` - 分类单个表格图像
@@ -1149,7 +1355,71 @@ OCR Span 与 Layout Block 匹配器,参考 MinerU 实现:
 - 支持线条检测辅助判断(只有横线或竖线时强制判断为无线表格)
 - 输出分类结果:`wired`(有线表格)或 `wireless`(无线表格)
 
-### 4. OutputFormatterV2 (来自 `ocr_utils`)
+### 6. CellFusionEngine (`wired_table/cell_fusion.py`) ⭐ 新增
+
+多源单元格融合引擎,融合UNet、RT-DETR和OCR的检测结果:
+
+**主要方法**:
+- `fuse()` - 融合多源单元格检测结果
+- `should_use_rtdetr()` - 判断是否需要使用RT-DETR(自适应策略)
+- `_fuse_cells()` - 执行智能融合(UNet + RT-DETR)
+- `_compensate_edge_cells()` - OCR边缘补偿
+
+**融合流程**:
+1. **Phase 1**: RT-DETR 端到端检测(conf>0.5)
+2. **Phase 2**: 智能融合策略
+   - 高IoU(>0.7):加权平均融合(UNet 60% + RT-DETR 40%)
+   - 低IoU:保留两个单元格,后续NMS去重
+3. **Phase 3**: NMS去重(IoU阈值0.5)
+4. **Phase 4**: 边界噪声过滤
+5. **Phase 5**: OCR边缘补偿(检测"有OCR无单元格"的位置)
+
+**自适应策略**:
+- UNet检测为0时:强制启用RT-DETR补救
+- 启用融合模式:对所有表格统一使用融合
+
+**配置参数**:
+```python
+unet_weight: 0.6             # UNet权重(结构性强)
+rtdetr_weight: 0.4           # RT-DETR权重(鲁棒性强)
+iou_merge_threshold: 0.7     # 高IoU合并阈值
+iou_nms_threshold: 0.5       # NMS去重阈值
+rtdetr_conf_threshold: 0.5   # RT-DETR置信度阈值
+enable_ocr_compensation: true  # 启用OCR补偿
+```
+
+**融合统计输出**:
+- `unet_count`: UNet检测数量
+- `rtdetr_count`: RT-DETR检测数量
+- `fused_count`: 最终融合数量
+- `merged_count`: 加权融合数量
+- `added_count`: RT-DETR独有数量
+- `ocr_compensated_count`: OCR补偿数量
+
+### 7. PaddleWiredTableCellsDetector (`paddle_wired_table_cells_detector.py`) ⭐ 新增
+
+RT-DETR单元格检测器(ONNX版本),用于有线表格单元格端到端检测:
+
+**主要方法**:
+- `detect()` - 检测表格中的单元格边界框
+- `_preprocess()` - 图像预处理(resize到640×640,归一化)
+- `_postprocess()` - 解析ONNX输出,转换坐标到原图
+
+**输入输出**:
+- 输入:表格图像(BGR格式,原图坐标系)
+- 输出:单元格列表,每个包含:
+  - `bbox`: [x1, y1, x2, y2](原图坐标)
+  - `score`: 置信度
+  - `category_id`: 0(cell)
+  - `width`, `height`: 单元格尺寸
+
+**特点**:
+- 使用ONNX Runtime推理,支持CPU/CoreML
+- 固定输入尺寸640×640(RT-DETR标准)
+- 自动坐标转换和边界裁剪
+- 支持置信度阈值过滤
+
+### 8. OutputFormatterV2 (来自 `ocr_utils`)
 
 统一输出格式化器,位于 `ocr_utils` 包中:
 - MinerU 标准 middle.json 格式
@@ -1164,7 +1434,7 @@ OCR Span 与 Layout Block 匹配器,参考 MinerU 实现:
 from ocr_utils import OutputFormatterV2
 ```
 
-### 5. TableCellMatcher (来自 `merger`)
+### 9. TableCellMatcher (来自 `merger`)
 
 表格单元格坐标匹配器:
 - 使用动态规划进行行内单元格匹配