Commit 3778cbc4 authored by liukaiwen's avatar liukaiwen

Merge branch 'master' of github.com:papayalove/Magic-PDF

parents 4c096443 5e4f9abc
......@@ -31,7 +31,7 @@
</p>
<p align="center">
👋 join us on <a href="https://discord.gg/AsQMhuMN" target="_blank">Discord</a> and <a href="https://cdn.vansin.top/internlm/mineru.jpg" target="_blank">WeChat</a>
👋 join us on <a href="https://discord.gg/gPxmVeGC" target="_blank">Discord</a> and <a href="https://cdn.vansin.top/internlm/mineru.jpg" target="_blank">WeChat</a>
</p>
</div>
......@@ -100,7 +100,17 @@ conda activate MinerU
#### 1. Install Magic-PDF
Install the full-feature package with pip:
**1.Install dependencies**
The full-feature package depends on detectron2, which requires a compilation installation.
If you need to compile it yourself, please refer to https://github.com/facebookresearch/detectron2/issues/5114
Alternatively, you can directly use our precompiled whl package (limited to Python 3.10):
```bash
pip install detectron2 --extra-index-url https://myhloli.github.io/wheels/
```
**2.Install the full-feature package with pip**
>Note: The pip-installed package supports CPU-only and is ideal for quick tests.
>
>For CUDA/MPS acceleration in production, see [Acceleration Using CUDA or MPS](#4-Acceleration-Using-CUDA-or-MPS).
......@@ -114,14 +124,6 @@ pip install magic-pdf[full]==0.6.2b1
> pip install magic-pdf[full-cpu]==0.6.1
> ```
The full-feature package depends on detectron2, which requires a compilation installation.
If you need to compile it yourself, please refer to https://github.com/facebookresearch/detectron2/issues/5114
Alternatively, you can directly use our precompiled whl package (limited to Python 3.10):
```bash
pip install detectron2 --extra-index-url https://myhloli.github.io/wheels/
```
#### 2. Downloading model weights files
......@@ -150,10 +152,16 @@ If you have an available Nvidia GPU or are using a Mac with Apple Silicon, you c
##### CUDA
You need to install the corresponding PyTorch version according to your CUDA version.
This example installs the CUDA 11.8 version.More information https://pytorch.org/get-started/locally/
This example installs the CUDA 11.8 version.More information https://pytorch.org/get-started/locally/
```bash
pip install --force-reinstall torch==2.3.1 torchvision==0.18.1 --index-url https://download.pytorch.org/whl/cu118
```
> ❗ ️Make sure to specify version
> ```bash
> torch==2.3.1 torchvision==0.18.1
> ```
> in the command, as these are the highest versions we support. Failing to specify the versions may result in automatically installing higher versions which can cause the program to fail.
Also, you need to modify the value of "device-mode" in the configuration file magic-pdf.json.
```json
{
......
......@@ -31,7 +31,7 @@
</p>
<p align="center">
👋 <a href="https://discord.gg/AsQMhuMN" target="_blank">Discord</a><a href="https://cdn.vansin.top/internlm/mineru.jpg" target="_blank">WeChat</a>で参加してください
👋 <a href="https://discord.gg/gPxmVeGC" target="_blank">Discord</a><a href="https://cdn.vansin.top/internlm/mineru.jpg" target="_blank">WeChat</a>で参加してください
</p>
</div>
......@@ -100,14 +100,8 @@ conda activate MinerU
#### 1. Magic-PDFのインストール
pipを使用してフル機能パッケージをインストールします:
>注意:pipでインストールされたパッケージはCPUのみをサポートし、クイックテストに最適です。
>
>CUDA/MPSによる加速については、[CUDAまたはMPSによる加速](#4-CUDAまたはMPSによる加速)を参照してください。
**1.依存パッケージのインストール**
```bash
pip install magic-pdf[full-cpu]
```
フル機能パッケージはdetectron2に依存しており、コンパイルインストールが必要です。
自分でコンパイルする必要がある場合は、https://github.com/facebookresearch/detectron2/issues/5114 を参照してください。
または、私たちの事前コンパイルされたwhlパッケージを直接使用できます(Python 3.10に限定):
......@@ -116,6 +110,21 @@ pip install magic-pdf[full-cpu]
pip install detectron2 --extra-index-url https://myhloli.github.io/wheels/
```
**2.pipを使用してフル機能パッケージをインストールします**
>注意:pipでインストールされたパッケージはCPUのみをサポートし、クイックテストに最適です。
>
>CUDA/MPSによる加速については、[CUDAまたはMPSによる加速](#4-CUDAまたはMPSによる加速)を参照してください。
```bash
pip install magic-pdf[full]==0.6.2b1
```
> ❗️❗️❗️
> 私たちは0.6.2 ベータ版を事前にリリースし、私たちのログに記載されている多くの問題に対処しました。しかし、このビルドはまだ完全なQAテストを経ておらず、最終的なリリース品質を表していません。問題に遭遇した場合は、問題を通じて速やかに報告するか、0.6.1バージョンに戻ることをお願いします。
> ```bash
> pip install magic-pdf[full-cpu]==0.6.1
> ```
#### 2. モデルの重みファイルのダウンロード
......
......@@ -25,7 +25,7 @@
</p>
<p align="center">
👋 join us on <a href="https://discord.gg/AsQMhuMN" target="_blank">Discord</a> and <a href="https://cdn.vansin.top/internlm/mineru.jpg" target="_blank">WeChat</a>
👋 join us on <a href="https://discord.gg/gPxmVeGC" target="_blank">Discord</a> and <a href="https://cdn.vansin.top/internlm/mineru.jpg" target="_blank">WeChat</a>
</p>
</div>
......@@ -94,25 +94,29 @@ conda activate MinerU
#### 1. 安装Magic-PDF
使用pip安装完整功能包:
**1.安装依赖**
完整功能包依赖detectron2,该库需要编译安装,如需自行编译,请参考 https://github.com/facebookresearch/detectron2/issues/5114
或是直接使用我们预编译的whl包:
> ❗️预编译版本仅支持64位系统(windows/linux/macOS)+pyton 3.10平台;不支持任何32位系统和非mac的arm平台,如系统不支持请自行编译安装。
```bash
pip install detectron2 --extra-index-url https://myhloli.github.io/wheels/ -i https://pypi.tuna.tsinghua.edu.cn/simple
```
**2.使用pip安装完整功能包**
> 受pypi限制,pip安装的完整功能包仅支持cpu推理,建议只用于快速测试解析能力。
>
> 如需在生产环境使用CUDA/MPS加速请参考[使用CUDA或MPS加速推理](#4-使用CUDA或MPS加速推理)
```bash
pip install magic-pdf[full-cpu] -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install magic-pdf[full]==0.6.2b1 -i https://mirrors.aliyun.com/pypi/simple/
```
> ❗️已收到多起由于镜像源和依赖冲突问题导致安装了错误版本软件包的反馈,请务必安装完成后通过以下命令验证版本是否正确
> ❗️❗️❗️
> 我们预发布了0.6.2beta版本,该版本解决了很多issue中提出的问题,同时提高了安装成功率。但是该版本未经过完整的QA测试,不代表最终正式发布的质量水平。如果你遇到任何问题,请通过提交issue的方式及时向我们反馈,或者回退到使用0.6.1版本。
> ```bash
> magic-pdf --version
> pip install magic-pdf[full-cpu]==0.6.1
> ```
> 如版本低于0.6.x,请提交issue进行反馈。
完整功能包依赖detectron2,该库需要编译安装,如需自行编译,请参考 https://github.com/facebookresearch/detectron2/issues/5114
或是直接使用我们预编译的whl包:
> ❗️预编译版本仅支持64位系统(windows/linux/macOS)+pyton 3.10平台;不支持任何32位系统和非mac的arm平台,如系统不支持请自行编译安装。
```bash
pip install detectron2 --extra-index-url https://myhloli.github.io/wheels/ -i https://pypi.tuna.tsinghua.edu.cn/simple
```
#### 2. 下载模型权重文件
......@@ -121,13 +125,17 @@ pip install detectron2 --extra-index-url https://myhloli.github.io/wheels/ -i ht
#### 3. 拷贝配置文件并进行配置
在仓库根目录可以获得 [magic-pdf.template.json](magic-pdf.template.json) 配置模版文件
> ❗️务必执行以下命令将配置文件拷贝到用户目录下,否则程序将无法运行
> ❗️务必执行以下命令将配置文件拷贝到【用户目录】下,否则程序将无法运行
>
> windows的用户目录为 "C:\Users\用户名", linux用户目录为 "/home/用户名", macOS用户目录为 "/Users/用户名"
```bash
cp magic-pdf.template.json ~/magic-pdf.json
```
在用户目录中找到magic-pdf.json文件并配置"models-dir"为[2. 下载模型权重文件](#2-下载模型权重文件)中下载的模型权重文件所在目录
> ❗️务必正确配置模型权重文件所在目录,否则会因为找不到模型文件而导致程序无法运行
>
> windows系统中应把路径中所有的"\\"替换为"/",否则会因为转义原因导致json文件语法错误。
```json
{
"models-dir": "/tmp/models"
......@@ -143,8 +151,14 @@ cp magic-pdf.template.json ~/magic-pdf.json
```bash
pip install --force-reinstall torch==2.3.1 torchvision==0.18.1 --index-url https://download.pytorch.org/whl/cu118
```
> ❗️务必在命令中指定以下版本
> ```bash
> torch==2.3.1 torchvision==0.18.1
> ```
> 这是我们支持的最高版本,如果不指定版本会自动安装更高版本导致程序无法运行
同时需要修改配置文件magic-pdf.json中"device-mode"的值
同时需要修改【用户目录】中配置文件magic-pdf.json中"device-mode"的值
```json
{
"device-mode":"cuda"
......
......@@ -27,7 +27,7 @@
<!-- join us -->
<p align="center">
👋 join us on <a href="https://discord.gg/AsQMhuMN" target="_blank">Discord</a> and <a href="https://cdn.vansin.top/internlm/mineru.jpg" target="_blank">WeChat</a>
👋 join us on <a href="https://discord.gg/gPxmVeGC" target="_blank">Discord</a> and <a href="https://cdn.vansin.top/internlm/mineru.jpg" target="_blank">WeChat</a>
</p>
</div>
......@@ -173,14 +173,14 @@ MinerU诞生于[书生-浦语](https://github.com/InternLM/InternLM)的预训练
```bash
pip install magic-pdf[full]==0.6.2b1 detectron2 --extra-index-url https://myhloli.github.io/wheels/ -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install magic-pdf[full]==0.6.2b1 detectron2 --extra-index-url https://myhloli.github.io/wheels/ -i https://mirrors.aliyun.com/pypi/simple/
```
> ❗️已收到多起由于镜像源和依赖冲突问题导致安装了错误版本软件包的反馈,请务必安装完成后通过以下命令验证版本是否正确
> ```bash
> magic-pdf --version
> ```
> 如版本低于0.6.2,请提交issue进行反馈。
> 如版本低于0.6.2b1,请提交issue进行反馈。
### 使用GPU
- [Ubuntu22.04LTS + GPU](docs/README_Ubuntu_CUDA_Acceleration_zh_CN.md)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment