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: update OCR model configurations to use v5 and enhance language handling
myhloli8f0cc14872b3
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorch_paddle.py b/mineru/model/ocr/paddleocr2pytorch/pytorch_paddle.pyindex 8a15a890..3f5095d4 100644--- a/mineru/model/ocr/paddleocr2pytorch/pytorch_paddle.py+++ b/mineru/model/ocr/paddleocr2pytorch/pytorch_paddle.py@@ -57,7 +57,7 @@ class PytorchPaddleOCR(TextSystem):self.lang = kwargs.get('lang', 'ch')device = get_device()- if device == 'cpu' and self.lang in ['ch', 'ch_server']:+ if device == 'cpu' and self.lang in ['ch', 'ch_server', 'japan', 'chinese_cht']:logger.warning("The current device in use is CPU. To ensure the speed of parsing, the language is automatically switched to ch_lite.")self.lang = 'ch_lite'diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/arch_config.yaml b/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/arch_config.yamlindex 2dd3b633..5d4d0369 100644--- a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/arch_config.yaml+++ b/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/arch_config.yaml@@ -120,6 +120,22 @@ ch_PP-OCRv5_det_infer:name: DBHeadk: 50+ch_PP-OCRv5_det_server_infer:+ model_type: det+ algorithm: DB+ Transform: null+ Backbone:+ name: PPHGNetV2_B4+ det: True+ Neck:+ name: LKPAN+ out_channels: 256+ intracl: True+ Head:+ name: PFHeadLocal+ k: 50+ mode: "large"+ch_PP-OCRv4_det_server_infer:model_type: detalgorithm: DBdiff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/models_config.yml b/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/models_config.ymlindex 876f3ee9..1cf69092 100644--- a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/models_config.yml+++ b/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/models_config.yml@@ -1,22 +1,22 @@lang:ch_lite:- det: ch_PP-OCRv3_det_infer.pth+ det: ch_PP-OCRv5_det_infer.pthrec: ch_PP-OCRv5_rec_infer.pthdict: ppocrv5_dict.txtch_lite_v4:- det: ch_PP-OCRv3_det_infer.pth+ det: ch_PP-OCRv5_det_infer.pthrec: ch_PP-OCRv4_rec_infer.pthdict: ppocr_keys_v1.txtch_server:- det: ch_PP-OCRv3_det_infer.pth+ det: ch_PP-OCRv5_det_infer.pthrec: ch_PP-OCRv5_rec_server_infer.pthdict: ppocrv5_dict.txtch_server_v4:- det: ch_PP-OCRv3_det_infer.pth+ det: ch_PP-OCRv5_det_infer.pthrec: ch_PP-OCRv4_rec_server_infer.pthdict: ppocr_keys_v1.txtch:- det: ch_PP-OCRv3_det_infer.pth+ det: ch_PP-OCRv5_det_infer.pthrec: ch_PP-OCRv4_rec_server_doc_infer.pthdict: ppocrv4_doc_dict.txten:@@ -28,12 +28,12 @@ lang:rec: korean_PP-OCRv3_rec_infer.pthdict: korean_dict.txtjapan:- det: Multilingual_PP-OCRv3_det_infer.pth- rec: japan_PP-OCRv3_rec_infer.pth+ det: ch_PP-OCRv5_det_infer.pth+ rec: ch_PP-OCRv5_rec_server_infer.pthdict: japan_dict.txtchinese_cht:- det: Multilingual_PP-OCRv3_det_infer.pth- rec: chinese_cht_PP-OCRv3_rec_infer.pth+ det: ch_PP-OCRv5_det_infer.pth+ rec: ch_PP-OCRv5_rec_server_infer.pthdict: chinese_cht_dict.txtta:det: Multilingual_PP-OCRv3_det_infer.pth