Browse Source

fix(修复无效ocr_poly处理逻辑): 注释掉无效的ocr_poly和文本检查逻辑,确保在ocr_poly为空时返回None,提升代码的健壮性和可读性。

zhch158_admin 5 days ago
parent
commit
398929fec5
1 changed files with 3 additions and 1 deletions
  1. 3 1
      ocr_tools/universal_doc_parser/core/table_coordinate_utils.py

+ 3 - 1
ocr_tools/universal_doc_parser/core/table_coordinate_utils.py

@@ -68,7 +68,9 @@ class TableCoordinateUtils:
         Returns:
             转换后的字典,或 None(如果无效)
         """
-        if not ocr_poly or not text:
+        # if not ocr_poly or not text:
+        # 如果没有 ocr_poly,则返回 None, 文字为空字符串也需要返回转换后的字典
+        if not ocr_poly:
             return None
         
         poly = []