MinerU将PDF转成md文件,并分拣图片
首先自行安装python3,必须大于3.10以上的版本
博主是已经有了python3,这里就不演示了
1.Magic-PDF 安装方法
conda create -n mineru python=3.12.8
如果之前安装 MinerU 时已创建过虚拟环境,可直接激活 是虚拟环境名mineru
conda activate mineru
然后使用pip
安装 Magic-PDF 完整版功能包
pip install -U magic-pdf[full] --extra-index-url https://wheels.myhloli.com -i https://mirrors.aliyun.com/pypi/simple
2.下载模型文件
从 ModelScope 下载(官方推荐这里下载)
首先安装modelscope
pip install modelscope
然后下载脚本文件
https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/scripts/download_models.py -O download_models.py
安装模型
python download_models.py
从 Hugging Face 下载(可选)
安装huggingface_hub
pip install huggingface_hub
接着下载下载脚本
wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/scripts/download_models_hf.py -O download_models_hf.py
安装模型
python download_models_hf.py