|
|
@@ -363,6 +363,7 @@ class ElementProcessors:
|
|
|
output_dir: Optional[str] = None,
|
|
|
basename: Optional[str] = None,
|
|
|
normalize_numbers: bool = True,
|
|
|
+ debug_mode: bool = False,
|
|
|
) -> Dict[str, Any]:
|
|
|
"""
|
|
|
使用 UNet 有线表格识别处理表格元素
|
|
|
@@ -397,7 +398,7 @@ class ElementProcessors:
|
|
|
raise RuntimeError("Wired table recognizer not available")
|
|
|
|
|
|
# 构造调试选项覆盖
|
|
|
- debug_opts_override = {}
|
|
|
+ debug_opts_override = {'enabled': debug_mode}
|
|
|
if output_dir:
|
|
|
debug_opts_override['output_dir'] = output_dir
|
|
|
if basename:
|
|
|
@@ -510,10 +511,7 @@ class ElementProcessors:
|
|
|
raise RuntimeError("VL recognizer not available")
|
|
|
|
|
|
try:
|
|
|
- vl_result = vl_recognizer.recognize_table(
|
|
|
- cropped_table,
|
|
|
- return_cells_coordinate=True
|
|
|
- )
|
|
|
+ vl_result = vl_recognizer.recognize_table(cropped_table)
|
|
|
table_html = vl_result.get('html', '')
|
|
|
logger.info(f"📊 VLM recognized table structure")
|
|
|
except Exception as e:
|