Skip to content

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

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

myhloli10bb08c8751f
diff --git a/mineru/model/table/rec/unet_table/utils.py b/mineru/model/table/rec/unet_table/utils.py
index 113f28d6..eae8fb0f 100644
--- a/mineru/model/table/rec/unet_table/utils.py
+++ b/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]
)