Kaynağa Gözat

fix: 将日志级别从 info 更改为 debug,以减少输出冗余

zhch158_admin 6 gün önce
ebeveyn
işleme
bfd018969b

+ 6 - 6
ocr_tools/universal_doc_parser/models/adapters/wired_table/grid_recovery.py

@@ -488,7 +488,7 @@ class GridRecovery:
             coverage_h = max_y - min_y
             expected_h = orig_h if orig_h else h / upscale
             
-            logger.info(
+            logger.debug(
                 f"📏 单元格Y轴覆盖验证:\n"
                 f"  - 最小Y: {min_y:.1f}\n"
                 f"  - 最大Y: {max_y:.1f}\n"
@@ -533,14 +533,14 @@ class GridRecovery:
                 name = f"{debug_prefix}_coordinate_verification_mask.png" if debug_prefix else "coordinate_verification_mask.png"
                 path = os.path.join(debug_dir, name)
                 cv2.imwrite(path, vis_mask)
-                logger.info(f"保存坐标验证图像(上采样mask): {path}")
+                logger.debug(f"保存坐标验证图像(上采样mask): {path}")
                 
             except Exception as e:
                 logger.warning(f"保存坐标验证图像失败: {e}")
         
         # 详细的坐标转换调试日志
         if len(bboxes) > 0:
-            logger.info(
+            logger.debug(
                 f"🔍 坐标转换验证:\n"
                 f"  - mask尺寸: [{h}, {w}]\n"
                 f"  - 原图尺寸: [{orig_h}, {orig_w}]\n"
@@ -553,7 +553,7 @@ class GridRecovery:
             sample_indices = [0, 1, 2] + [len(bboxes) - 3, len(bboxes) - 2, len(bboxes) - 1]
             sample_indices = [i for i in sample_indices if 0 <= i < len(bboxes)]
             
-            logger.info("🔍 样本单元格坐标转换详情:")
+            logger.debug("🔍 样本单元格坐标转换详情:")
             for idx in sample_indices:
                 bbox_orig = bboxes[idx]
                 # 反推上采样坐标(用于验证)
@@ -562,7 +562,7 @@ class GridRecovery:
                 w_up = (bbox_orig[2] - bbox_orig[0]) * scale_w
                 h_up = (bbox_orig[3] - bbox_orig[1]) * scale_h
                 
-                logger.info(
+                logger.debug(
                     f"  单元格 {idx}: 原图坐标 [{bbox_orig[0]:.1f}, {bbox_orig[1]:.1f}, "
                     f"{bbox_orig[2]:.1f}, {bbox_orig[3]:.1f}] "
                     f"(尺寸: {bbox_orig[2]-bbox_orig[0]:.1f}x{bbox_orig[3]-bbox_orig[1]:.1f}) "
@@ -576,7 +576,7 @@ class GridRecovery:
                 last_y = bboxes[-1][3]
                 expected_height = last_y - first_y
                 actual_image_height = orig_h if orig_h else h / upscale
-                logger.info(
+                logger.debug(
                     f"🔍 系统性偏移检查:\n"
                     f"  - 第一个单元格y1: {first_y:.1f}\n"
                     f"  - 最后一个单元格y2: {last_y:.1f}\n"