Ubuntu下部署MinerU文字识别服务

前期需要安装好uv虚拟环境,Nvidia驱动和CUDA

-------------------------------------

1、拉取项目源码

git clone https://github.com/opendatalab/MinerU.git && cd MinerU


2、创建uv虚拟环境并激活

uv venv && source .venv/bin/activate

3、源码安装
uv pip install -e .[core] -i https://mirrors.aliyun.com/pypi/simple

4、设置魔搭为模型源:
export MINERU_MODEL_SOURCE=modelscope

5、使用命令行识别:
(把当前路径下的名为1001.pdf识别后存储在当前路径下的output文件夹内)
mineru -p ./1001.pdf -o ./output/

6、启动webui可视化前端页面:

mineru-gradio --server-name 0.0.0.0 --server-port 7860


7、启动Api服务:
mineru-api --host 0.0.0.0 --port 8000
在浏览器中访问  http://127.0.0.1:8000/docs   查看API文档。




评论

此博客中的热门博文

通过命令行在Github上发布项目的新版本

利用GitHub免费的静态页面托管空间发布网页

本地部署OpenAvatarChat实时交互数字人系统