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
feat: adjust OCR detection base batch size and optimize batch ratio logic for GPU memory
myhlolib49b0ce3b8de
diff --git a/mineru/backend/pipeline/batch_analyze.py b/mineru/backend/pipeline/batch_analyze.pyindex 89e7264c..05bf7a17 100644--- a/mineru/backend/pipeline/batch_analyze.py+++ b/mineru/backend/pipeline/batch_analyze.py@@ -27,7 +27,7 @@ from ...utils.pdf_image_tools import get_crop_np_imgLAYOUT_BASE_BATCH_SIZE = 1MFR_BASE_BATCH_SIZE = 16-OCR_DET_BASE_BATCH_SIZE = 16+OCR_DET_BASE_BATCH_SIZE = 8TABLE_ORI_CLS_BATCH_SIZE = 16TABLE_Wired_Wireless_CLS_BATCH_SIZE = 16diff --git a/mineru/backend/pipeline/pipeline_analyze.py b/mineru/backend/pipeline/pipeline_analyze.pyindex 8bc9064b..a625528f 100644--- a/mineru/backend/pipeline/pipeline_analyze.py+++ b/mineru/backend/pipeline/pipeline_analyze.py@@ -553,11 +553,11 @@ def batch_image_analyze(gpu_memory = get_vram(device)if gpu_memory >= 16:batch_ratio = 16- elif gpu_memory >= 12:- batch_ratio = 8elif gpu_memory >= 8:- batch_ratio = 4+ batch_ratio = 8elif gpu_memory >= 6:+ batch_ratio = 4+ elif gpu_memory >= 4:batch_ratio = 2else:batch_ratio = 1