Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.
Python ai4sciencedocument-analysisdocxextract-datalayout-analysisocrparserpdfpdf-converterpdf-extractor-llmpdf-extractor-pretrainpdf-extractor-ragpdf-parserpptxpythonxlsx
fix: update batch_analyze to use PIL images for layout prediction
myhloli0bb423811427
diff --git a/mineru/backend/pipeline/batch_analyze.py b/mineru/backend/pipeline/batch_analyze.pyindex 208a1ef8..a58cf61e 100644--- a/mineru/backend/pipeline/batch_analyze.py+++ b/mineru/backend/pipeline/batch_analyze.py@@ -38,12 +38,14 @@ class BatchAnalyze:)atom_model_manager = AtomModelSingleton()+ pil_images = [image for image, _, _ in images_with_extra_info]+np_images = [np.asarray(image) for image, _, _ in images_with_extra_info]# doclayout_yoloimages_layout_res += self.model.layout_model.batch_predict(- np_images, YOLO_LAYOUT_BASE_BATCH_SIZE+ pil_images, YOLO_LAYOUT_BASE_BATCH_SIZE)if self.formula_enable:@@ -89,6 +91,7 @@ class BatchAnalyze:# table_img, _ = crop_img(table_res, pil_img)# bbox = (241, 208, 1475, 2019)scale = 10/3+ # scale = 1crop_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))