Skip to content

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

refactor: rename files and update import paths for consistency

myhloli499e877165c4
diff --git a/mineru/model/mfr/pp_formulanet_plus_m/predict_formula.py b/mineru/model/mfr/pp_formulanet_plus_m/predict_formula.py
index 1ba6c280..bee9dd49 100644
--- a/mineru/model/mfr/pp_formulanet_plus_m/predict_formula.py
+++ b/mineru/model/mfr/pp_formulanet_plus_m/predict_formula.py
@@ -3,8 +3,8 @@ import torch
import yaml
from pathlib import Path
from tqdm import tqdm
-from mineru.model.ocr.paddleocr2pytorch.tools.infer import pytorchocr_utility
-from mineru.model.ocr.paddleocr2pytorch.pytorchocr.base_ocr_v20 import BaseOCRV20
+from mineru.model.utils.tools.infer import pytorchocr_utility
+from mineru.model.utils.pytorchocr.base_ocr_v20 import BaseOCRV20
from .processors import (
UniMERNetImgDecode,
UniMERNetTestTransform,
@@ -24,7 +24,14 @@ class FormulaRecognizer(BaseOCRV20):
weight_dir,
"PP-FormulaNet_plus-M.pth",
)
- self.yaml_path = Path(__file__).parent / "config" / "arch_config.yaml"
+ self.yaml_path = os.path.join(
+ Path(__file__).parent.parent.parent,
+ "utils",
+ "pytorchocr",
+ "utils",
+ "resources",
+ "pp_formulanet_arch_config.yaml"
+ )
self.infer_yaml_path = os.path.join(
weight_dir,
"PP-FormulaNet_plus-M_inference.yml",
@@ -38,6 +45,7 @@ class FormulaRecognizer(BaseOCRV20):
super(FormulaRecognizer, self).__init__(network_config)
self.load_state_dict(weights)
+ # device = "cpu"
self.device = torch.device(device) if isinstance(device, str) else device
self.net.to(self.device)
self.net.eval()
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorch_paddle.py b/mineru/model/ocr/paddleocr2pytorch/pytorch_paddle.py
index 862584ed..4e5447fa 100644
--- a/mineru/model/ocr/paddleocr2pytorch/pytorch_paddle.py
+++ b/mineru/model/ocr/paddleocr2pytorch/pytorch_paddle.py
@@ -13,8 +13,8 @@ from mineru.utils.config_reader import get_device
from mineru.utils.enum_class import ModelPath
from mineru.utils.models_download_utils import auto_download_and_get_model_root_path
from mineru.utils.ocr_utils import check_img, preprocess_image, sorted_boxes, merge_det_boxes, update_det_boxes, get_rotate_crop_image
-from mineru.model.ocr.paddleocr2pytorch.tools.infer.predict_system import TextSystem
-from mineru.model.ocr.paddleocr2pytorch.tools.infer import pytorchocr_utility as utility
+from mineru.model.utils.tools.infer.predict_system import TextSystem
+from mineru.model.utils.tools.infer import pytorchocr_utility as utility
import argparse
@@ -47,7 +47,7 @@ def get_model_params(lang, config):
raise Exception (f'Language {lang} not supported')
-root_dir = Path(__file__).resolve().parent
+root_dir = os.path.join(Path(__file__).resolve().parent.parent.parent, 'utils')
class PytorchPaddleOCR(TextSystem):
diff --git a/mineru/model/ocr/paddleocr2pytorch/tools/infer/__init__.py b/mineru/model/utils/__init__.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/tools/infer/__init__.py
rename to mineru/model/utils/__init__.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/__init__.py b/mineru/model/utils/pytorchocr/__init__.py
old mode 100755
new mode 100644
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/__init__.py
rename to mineru/model/utils/pytorchocr/__init__.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/base_ocr_v20.py b/mineru/model/utils/pytorchocr/base_ocr_v20.py
old mode 100755
new mode 100644
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/base_ocr_v20.py
rename to mineru/model/utils/pytorchocr/base_ocr_v20.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/data/__init__.py b/mineru/model/utils/pytorchocr/data/__init__.py
old mode 100755
new mode 100644
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/data/__init__.py
rename to mineru/model/utils/pytorchocr/data/__init__.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/data/imaug/__init__.py b/mineru/model/utils/pytorchocr/data/imaug/__init__.py
old mode 100755
new mode 100644
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/data/imaug/__init__.py
rename to mineru/model/utils/pytorchocr/data/imaug/__init__.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/data/imaug/operators.py b/mineru/model/utils/pytorchocr/data/imaug/operators.py
old mode 100755
new mode 100644
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/data/imaug/operators.py
rename to mineru/model/utils/pytorchocr/data/imaug/operators.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/__init__.py b/mineru/model/utils/pytorchocr/modeling/__init__.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/__init__.py
rename to mineru/model/utils/pytorchocr/modeling/__init__.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/architectures/__init__.py b/mineru/model/utils/pytorchocr/modeling/architectures/__init__.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/architectures/__init__.py
rename to mineru/model/utils/pytorchocr/modeling/architectures/__init__.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/architectures/base_model.py b/mineru/model/utils/pytorchocr/modeling/architectures/base_model.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/architectures/base_model.py
rename to mineru/model/utils/pytorchocr/modeling/architectures/base_model.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/backbones/__init__.py b/mineru/model/utils/pytorchocr/modeling/backbones/__init__.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/backbones/__init__.py
rename to mineru/model/utils/pytorchocr/modeling/backbones/__init__.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/backbones/det_mobilenet_v3.py b/mineru/model/utils/pytorchocr/modeling/backbones/det_mobilenet_v3.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/backbones/det_mobilenet_v3.py
rename to mineru/model/utils/pytorchocr/modeling/backbones/det_mobilenet_v3.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/backbones/rec_donut_swin.py b/mineru/model/utils/pytorchocr/modeling/backbones/rec_donut_swin.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/backbones/rec_donut_swin.py
rename to mineru/model/utils/pytorchocr/modeling/backbones/rec_donut_swin.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/backbones/rec_hgnet.py b/mineru/model/utils/pytorchocr/modeling/backbones/rec_hgnet.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/backbones/rec_hgnet.py
rename to mineru/model/utils/pytorchocr/modeling/backbones/rec_hgnet.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/backbones/rec_lcnetv3.py b/mineru/model/utils/pytorchocr/modeling/backbones/rec_lcnetv3.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/backbones/rec_lcnetv3.py
rename to mineru/model/utils/pytorchocr/modeling/backbones/rec_lcnetv3.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/backbones/rec_mobilenet_v3.py b/mineru/model/utils/pytorchocr/modeling/backbones/rec_mobilenet_v3.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/backbones/rec_mobilenet_v3.py
rename to mineru/model/utils/pytorchocr/modeling/backbones/rec_mobilenet_v3.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/backbones/rec_mv1_enhance.py b/mineru/model/utils/pytorchocr/modeling/backbones/rec_mv1_enhance.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/backbones/rec_mv1_enhance.py
rename to mineru/model/utils/pytorchocr/modeling/backbones/rec_mv1_enhance.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/backbones/rec_pphgnetv2.py b/mineru/model/utils/pytorchocr/modeling/backbones/rec_pphgnetv2.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/backbones/rec_pphgnetv2.py
rename to mineru/model/utils/pytorchocr/modeling/backbones/rec_pphgnetv2.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/backbones/rec_svtrnet.py b/mineru/model/utils/pytorchocr/modeling/backbones/rec_svtrnet.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/backbones/rec_svtrnet.py
rename to mineru/model/utils/pytorchocr/modeling/backbones/rec_svtrnet.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/common.py b/mineru/model/utils/pytorchocr/modeling/common.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/common.py
rename to mineru/model/utils/pytorchocr/modeling/common.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/heads/__init__.py b/mineru/model/utils/pytorchocr/modeling/heads/__init__.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/heads/__init__.py
rename to mineru/model/utils/pytorchocr/modeling/heads/__init__.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/heads/cls_head.py b/mineru/model/utils/pytorchocr/modeling/heads/cls_head.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/heads/cls_head.py
rename to mineru/model/utils/pytorchocr/modeling/heads/cls_head.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/heads/det_db_head.py b/mineru/model/utils/pytorchocr/modeling/heads/det_db_head.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/heads/det_db_head.py
rename to mineru/model/utils/pytorchocr/modeling/heads/det_db_head.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/heads/rec_ctc_head.py b/mineru/model/utils/pytorchocr/modeling/heads/rec_ctc_head.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/heads/rec_ctc_head.py
rename to mineru/model/utils/pytorchocr/modeling/heads/rec_ctc_head.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/heads/rec_multi_head.py b/mineru/model/utils/pytorchocr/modeling/heads/rec_multi_head.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/heads/rec_multi_head.py
rename to mineru/model/utils/pytorchocr/modeling/heads/rec_multi_head.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/heads/rec_ppformulanet_head.py b/mineru/model/utils/pytorchocr/modeling/heads/rec_ppformulanet_head.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/heads/rec_ppformulanet_head.py
rename to mineru/model/utils/pytorchocr/modeling/heads/rec_ppformulanet_head.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/heads/rec_unimernet_head.py b/mineru/model/utils/pytorchocr/modeling/heads/rec_unimernet_head.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/heads/rec_unimernet_head.py
rename to mineru/model/utils/pytorchocr/modeling/heads/rec_unimernet_head.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/necks/__init__.py b/mineru/model/utils/pytorchocr/modeling/necks/__init__.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/necks/__init__.py
rename to mineru/model/utils/pytorchocr/modeling/necks/__init__.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/necks/db_fpn.py b/mineru/model/utils/pytorchocr/modeling/necks/db_fpn.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/necks/db_fpn.py
rename to mineru/model/utils/pytorchocr/modeling/necks/db_fpn.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/necks/intracl.py b/mineru/model/utils/pytorchocr/modeling/necks/intracl.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/necks/intracl.py
rename to mineru/model/utils/pytorchocr/modeling/necks/intracl.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/necks/rnn.py b/mineru/model/utils/pytorchocr/modeling/necks/rnn.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/modeling/necks/rnn.py
rename to mineru/model/utils/pytorchocr/modeling/necks/rnn.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/postprocess/__init__.py b/mineru/model/utils/pytorchocr/postprocess/__init__.py
old mode 100755
new mode 100644
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/postprocess/__init__.py
rename to mineru/model/utils/pytorchocr/postprocess/__init__.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/postprocess/cls_postprocess.py b/mineru/model/utils/pytorchocr/postprocess/cls_postprocess.py
old mode 100755
new mode 100644
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/postprocess/cls_postprocess.py
rename to mineru/model/utils/pytorchocr/postprocess/cls_postprocess.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/postprocess/db_postprocess.py b/mineru/model/utils/pytorchocr/postprocess/db_postprocess.py
old mode 100755
new mode 100644
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/postprocess/db_postprocess.py
rename to mineru/model/utils/pytorchocr/postprocess/db_postprocess.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/postprocess/rec_postprocess.py b/mineru/model/utils/pytorchocr/postprocess/rec_postprocess.py
old mode 100755
new mode 100644
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/postprocess/rec_postprocess.py
rename to mineru/model/utils/pytorchocr/postprocess/rec_postprocess.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/__init__.py b/mineru/model/utils/pytorchocr/utils/__init__.py
old mode 100755
new mode 100644
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/__init__.py
rename to mineru/model/utils/pytorchocr/utils/__init__.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/arch_config.yaml b/mineru/model/utils/pytorchocr/utils/resources/arch_config.yaml
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/arch_config.yaml
rename to mineru/model/utils/pytorchocr/utils/resources/arch_config.yaml
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/arabic_dict.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/arabic_dict.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/arabic_dict.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/arabic_dict.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/chinese_cht_dict.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/chinese_cht_dict.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/chinese_cht_dict.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/chinese_cht_dict.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/cyrillic_dict.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/cyrillic_dict.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/cyrillic_dict.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/cyrillic_dict.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/devanagari_dict.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/devanagari_dict.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/devanagari_dict.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/devanagari_dict.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/en_dict.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/en_dict.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/en_dict.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/en_dict.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/japan_dict.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/japan_dict.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/japan_dict.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/japan_dict.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ka_dict.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/ka_dict.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ka_dict.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/ka_dict.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/korean_dict.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/korean_dict.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/korean_dict.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/korean_dict.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/latin_dict.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/latin_dict.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/latin_dict.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/latin_dict.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ppocr_keys_v1.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/ppocr_keys_v1.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ppocr_keys_v1.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/ppocr_keys_v1.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ppocrv4_doc_dict.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/ppocrv4_doc_dict.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ppocrv4_doc_dict.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/ppocrv4_doc_dict.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ppocrv5_dict.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/ppocrv5_dict.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ppocrv5_dict.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/ppocrv5_dict.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ppocrv5_el_dict.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/ppocrv5_el_dict.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ppocrv5_el_dict.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/ppocrv5_el_dict.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ppocrv5_en_dict.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/ppocrv5_en_dict.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ppocrv5_en_dict.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/ppocrv5_en_dict.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ppocrv5_eslav_dict.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/ppocrv5_eslav_dict.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ppocrv5_eslav_dict.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/ppocrv5_eslav_dict.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ppocrv5_korean_dict.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/ppocrv5_korean_dict.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ppocrv5_korean_dict.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/ppocrv5_korean_dict.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ppocrv5_latin_dict.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/ppocrv5_latin_dict.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ppocrv5_latin_dict.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/ppocrv5_latin_dict.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ppocrv5_th_dict.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/ppocrv5_th_dict.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ppocrv5_th_dict.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/ppocrv5_th_dict.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ta_dict.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/ta_dict.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/ta_dict.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/ta_dict.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/te_dict.txt b/mineru/model/utils/pytorchocr/utils/resources/dict/te_dict.txt
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/dict/te_dict.txt
rename to mineru/model/utils/pytorchocr/utils/resources/dict/te_dict.txt
diff --git a/mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/models_config.yml b/mineru/model/utils/pytorchocr/utils/resources/models_config.yml
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/pytorchocr/utils/resources/models_config.yml
rename to mineru/model/utils/pytorchocr/utils/resources/models_config.yml
diff --git a/mineru/model/mfr/pp_formulanet_plus_m/config/arch_config.yaml b/mineru/model/utils/pytorchocr/utils/resources/pp_formulanet_arch_config.yaml
similarity index 100%
rename from mineru/model/mfr/pp_formulanet_plus_m/config/arch_config.yaml
rename to mineru/model/utils/pytorchocr/utils/resources/pp_formulanet_arch_config.yaml
diff --git a/mineru/model/ocr/paddleocr2pytorch/tools/__init__.py b/mineru/model/utils/tools/__init__.py
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/tools/__init__.py
rename to mineru/model/utils/tools/__init__.py
diff --git a/mineru/model/utils/tools/infer/__init__.py b/mineru/model/utils/tools/infer/__init__.py
new file mode 100644
index 00000000..1e17167c
--- /dev/null
+++ b/mineru/model/utils/tools/infer/__init__.py
@@ -0,0 +1 @@
+# Copyright (c) Opendatalab. All rights reserved.
diff --git a/mineru/model/ocr/paddleocr2pytorch/tools/infer/predict_cls.py b/mineru/model/utils/tools/infer/predict_cls.py
old mode 100755
new mode 100644
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/tools/infer/predict_cls.py
rename to mineru/model/utils/tools/infer/predict_cls.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/tools/infer/predict_det.py b/mineru/model/utils/tools/infer/predict_det.py
old mode 100755
new mode 100644
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/tools/infer/predict_det.py
rename to mineru/model/utils/tools/infer/predict_det.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/tools/infer/predict_rec.py b/mineru/model/utils/tools/infer/predict_rec.py
old mode 100755
new mode 100644
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/tools/infer/predict_rec.py
rename to mineru/model/utils/tools/infer/predict_rec.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/tools/infer/predict_system.py b/mineru/model/utils/tools/infer/predict_system.py
old mode 100755
new mode 100644
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/tools/infer/predict_system.py
rename to mineru/model/utils/tools/infer/predict_system.py
diff --git a/mineru/model/ocr/paddleocr2pytorch/tools/infer/pytorchocr_utility.py b/mineru/model/utils/tools/infer/pytorchocr_utility.py
old mode 100755
new mode 100644
similarity index 100%
rename from mineru/model/ocr/paddleocr2pytorch/tools/infer/pytorchocr_utility.py
rename to mineru/model/utils/tools/infer/pytorchocr_utility.py