From 2dc6f9501b70eb4500341e986463d4e2baf01c06 Mon Sep 17 00:00:00 2001 From: myhloli Date: Sat, 13 Jul 2024 01:01:40 +0800 Subject: [PATCH] docs(readme): Optimize the Installation Process --- README.md | 39 ++++++++++++++++----------------------- README_zh-CN.md | 36 +++++++++++++++--------------------- 2 files changed, 31 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index b55a2a4a..9b47acbe 100644 --- a/README.md +++ b/README.md @@ -75,37 +75,30 @@ https://github.com/opendatalab/MinerU/assets/11393164/618937cb-dc6a-4646-b433-e3 - Python >= 3.9 -It is recommended to use a virtual environment, either with venv or conda. -Development is based on Python 3.10, should you encounter problems with other Python versions, please switch to Python 3.10. - +Using a virtual environment is recommended to avoid potential dependency conflicts; both venv and conda are suitable. +For example: +```bash +conda create -n MinerU python=3.10 +conda activate MinerU +``` ### Usage Instructions #### 1. Install Magic-PDF +Install using pip: ```bash -# If you only need the basic features (without built-in model parsing functionality) pip install magic-pdf -# or -# For complete parsing capabilities (including high-precision model parsing) +``` +Alternatively, for built-in high-precision model parsing capabilities, use: +```bash pip install magic-pdf[full-cpu] - -# For high-precision model parsing, you will need to install the dependency detectron2. -# For detectron2, compile it yourself as per https://github.com/facebookresearch/detectron2/issues/5114 -# Or use our precompiled wheel - -# windows -pip install https://github.com/opendatalab/MinerU/raw/master/assets/whl/detectron2-0.6-cp310-cp310-win_amd64.whl - -# linux -pip install https://github.com/opendatalab/MinerU/raw/master/assets/whl/detectron2-0.6-cp310-cp310-linux_x86_64.whl - -# macOS(Intel) -pip install https://github.com/opendatalab/MinerU/raw/master/assets/whl/detectron2-0.6-cp310-cp310-macosx_10_9_universal2.whl - -# macOS(M1/M2/M3) -pip install https://github.com/opendatalab/MinerU/raw/master/assets/whl/detectron2-0.6-cp310-cp310-macosx_11_0_arm64.whl - +``` +The high-precision models depend on detectron2, which requires a compiled installation. +If you need to compile it yourself, refer to https://github.com/facebookresearch/detectron2/issues/5114 +Or directly use our pre-compiled wheel packages (limited to python 3.10): +```bash +pip install detectron2 --extra-index-url https://myhloli.github.io/wheels/ ``` diff --git a/README_zh-CN.md b/README_zh-CN.md index 904380bb..19ad35fe 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -70,36 +70,30 @@ https://github.com/opendatalab/MinerU/assets/11393164/618937cb-dc6a-4646-b433-e3 python >= 3.9 -推荐使用虚拟环境,venv和conda皆可。 +推荐使用虚拟环境,以避免可能发生的依赖冲突,venv和conda均可使用。 +例如: +```bash +conda create -n MinerU python=3.10 +conda activate MinerU +``` 开发基于python 3.10,如果在其他版本python出现问题请切换至3.10。 ### 使用说明 #### 1. 安装Magic-PDF +使用pip安装: ```bash -# 如果只需要基础功能(不含内置模型解析功能) pip install magic-pdf -# or -# 完整解析功能(含内置高精度模型解析功能) +``` +或者,需要内置高精度模型解析功能,使用: +```bash pip install magic-pdf[full-cpu] - -# 只有在需要高精度模型解析功能时,您需要额外安装依赖 detectron2 -# detectron2 需要编译安装,自行编译安装可以参考https://github.com/facebookresearch/detectron2/issues/5114 -# 或直接使用我们编译好的的whl包,不同系统请自行选择适配包安装 - -# windows -pip install https://github.com/opendatalab/MinerU/raw/master/assets/whl/detectron2-0.6-cp310-cp310-win_amd64.whl - -# linux -pip install https://github.com/opendatalab/MinerU/raw/master/assets/whl/detectron2-0.6-cp310-cp310-linux_x86_64.whl - -# macOS(Intel) -pip install https://github.com/opendatalab/MinerU/raw/master/assets/whl/detectron2-0.6-cp310-cp310-macosx_10_9_universal2.whl - -# macOS(M1/M2/M3) -pip install https://github.com/opendatalab/MinerU/raw/master/assets/whl/detectron2-0.6-cp310-cp310-macosx_11_0_arm64.whl - +``` +高精度模型依赖于detectron2,该库需要编译安装,如需自行编译,请参考https://github.com/facebookresearch/detectron2/issues/5114 +或是直接使用我们预编译的whl包(仅限python 3.10): +```bash +pip install detectron2 --extra-index-url https://myhloli.github.io/wheels/ ``` #### 2. 下载模型权重文件