Explorar o código

fix: update plot_rec_box_with_logic_info to accept image directly instead of file path

myhloli hai 2 meses
pai
achega
10bb08c875
Modificáronse 1 ficheiros con 2 adicións e 3 borrados
  1. 2 3
      mineru/model/table/rec/unet_table/utils.py

+ 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 = cv2.imread(img_path)
         img = cv2.copyMakeBorder(
             img, 0, 0, 0, 100, cv2.BORDER_CONSTANT, value=[255, 255, 255]
         )