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
refactor: optimize OCR batch processing and enhance image cropping logic
myhloli6b1df41947a8
diff --git a/mineru/backend/pipeline/batch_analyze.py b/mineru/backend/pipeline/batch_analyze.pyindex c7f442bb..7a2bbdb5 100644--- a/mineru/backend/pipeline/batch_analyze.py+++ b/mineru/backend/pipeline/batch_analyze.py@@ -127,7 +127,7 @@ class BatchAnalyze:if not lang_crop_list:continue- logger.info(f"Processing OCR detection for language {lang} with {len(lang_crop_list)} images")+ # logger.info(f"Processing OCR detection for language {lang} with {len(lang_crop_list)} images")# 获取OCR模型ocr_model = atom_model_manager.get_atom_model(@@ -171,7 +171,7 @@ class BatchAnalyze:# 批处理检测batch_size = min(len(batch_images), self.batch_ratio * 16) # 增加批处理大小- logger.debug(f"OCR-det batch: {batch_size} images, target size: {target_h}x{target_w}")+ # logger.debug(f"OCR-det batch: {batch_size} images, target size: {target_h}x{target_w}")batch_results = ocr_model.text_detector.batch_predict(batch_images, batch_size)# 处理批处理结果