소스 검색

Merge pull request #3383 from myhloli/dev

Dev
Xiaomeng Zhao 2 달 전
부모
커밋
3e88f78c5c
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 0
      mineru/backend/pipeline/batch_analyze.py
  2. 2 3
      mineru/model/table/rec/unet_table/utils.py

+ 1 - 0
mineru/backend/pipeline/batch_analyze.py

@@ -96,6 +96,7 @@ class BatchAnalyze:
                 # table_img, _ = crop_img(table_res, pil_img)
                 # bbox = (241, 208, 1475, 2019)
                 scale = 10/3
+                # scale = 1
                 crop_xmin, crop_ymin = int(table_res['poly'][0]), int(table_res['poly'][1])
                 crop_xmax, crop_ymax = int(table_res['poly'][4]), int(table_res['poly'][5])
                 bbox = (int(crop_xmin/scale), int(crop_ymin/scale), int(crop_xmax/scale), int(crop_ymax/scale))

+ 2 - 3
mineru/model/table/rec/unet_table/utils.py

@@ -394,7 +394,7 @@ class VisTable:
         if save_logic_path:
             polygons = [[box[0], box[1], box[4], box[5]] for box in table_cell_bboxes]
             self.plot_rec_box_with_logic_info(
-                img_path, save_logic_path, table_logic_points, polygons
+                img, save_logic_path, table_logic_points, polygons
             )
         return drawed_img
 
@@ -419,7 +419,7 @@ class VisTable:
         return html_with_border
 
     def plot_rec_box_with_logic_info(
-        self, img_path, output_path, logic_points, sorted_polygons
+        self, img, output_path, logic_points, sorted_polygons
     ):
         """
         :param img_path
@@ -429,7 +429,6 @@ class VisTable:
         :return:
         """
         # 读取原图
-        img = img_path
         img = cv2.copyMakeBorder(
             img, 0, 0, 0, 100, cv2.BORDER_CONSTANT, value=[255, 255, 255]
         )