|
|
@@ -823,7 +823,18 @@ class EnhancedDocPipeline:
|
|
|
if use_table_classification and self.table_classifier:
|
|
|
bbox = item.get('bbox', [])
|
|
|
table_img = CoordinateUtils.crop_region(detection_image, bbox)
|
|
|
- cls_result = self.table_classifier.classify(table_img)
|
|
|
+
|
|
|
+ # 构造调试选项
|
|
|
+ cls_debug_opts = {}
|
|
|
+ if output_dir:
|
|
|
+ cls_debug_opts['output_dir'] = output_dir
|
|
|
+ if basename:
|
|
|
+ cls_debug_opts['prefix'] = f"{basename}_{idx}"
|
|
|
+
|
|
|
+ cls_result = self.table_classifier.classify(
|
|
|
+ table_img,
|
|
|
+ debug_options=cls_debug_opts
|
|
|
+ )
|
|
|
table_type = cls_result.get('table_type', 'wireless')
|
|
|
confidence = cls_result.get('confidence', 0.0)
|
|
|
logger.info(f"📊 Table {idx} classified as '{table_type}' (conf: {confidence:.3f})")
|