ソースを参照

增加步长提高points2lines方法的速度

luojiehua 3 年 前
コミット
6b4944d333
2 ファイル変更8 行追加5 行削除
  1. 4 1
      format_convert/utils.py
  2. 4 4
      otr/table_line.py

+ 4 - 1
format_convert/utils.py

@@ -1072,7 +1072,10 @@ class LineTable:
                 if not _find:
                     clusters_rects.append([_rect])
 
-
+        # print("textbox:===================")
+        # for _textbox in list_textbox:
+        #     print(_textbox.get_text())
+        # print("textbox:======>>>>>>>>>>>>>")
 
 
         # cul spans

+ 4 - 4
otr/table_line.py

@@ -239,7 +239,7 @@ def points2lines(pred, sourceP_LB=True, prob=0.2, line_width=7, padding=3, min_l
     _last = False
     _current = False
     while 1:
-        h_index += 2
+        h_index += 5
         if h_index>=height:
             break
         w_index = -1
@@ -248,7 +248,7 @@ def points2lines(pred, sourceP_LB=True, prob=0.2, line_width=7, padding=3, min_l
         else:
             h_i = h_index
         while 1:
-            w_index += 2
+            w_index += 5
             if w_index>=width:
                 break
             if _sum[w_index]<min_len:
@@ -274,12 +274,12 @@ def points2lines(pred, sourceP_LB=True, prob=0.2, line_width=7, padding=3, min_l
     w_index = -1
     _sum = list(np.sum(np.array((pred[...,0]>prob)).astype(int),axis=1))
     while 1:
-        w_index += 2
+        w_index += 5
         if w_index>=width:
             break
         h_index = -1
         while 1:
-            h_index += 2
+            h_index += 5
             if h_index>=height:
                 break
             if _sum[h_index]<min_len: