Skip to content

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

Merge branch 'master' into release-0.9.0

Xiaomeng Zhao140247931662
diff --cc README.md
index d396dedd,9df61a28..82bcc84b
--- a/README.md
+++ b/README.md
@@@ -18,8 -18,8 +18,10 @@@
[![HuggingFace](https://img.shields.io/badge/Demo_on_HuggingFace-yellow.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAABYCAMAAACkl9t/AAAAk1BMVEVHcEz/nQv/nQv/nQr/nQv/nQr/nQv/nQv/nQr/wRf/txT/pg7/yRr/rBD/zRz/ngv/oAz/zhz/nwv/txT/ngv/0B3+zBz/nQv/0h7/wxn/vRb/thXkuiT/rxH/pxD/ogzcqyf/nQvTlSz/czCxky7/SjifdjT/Mj3+Mj3wMj15aTnDNz+DSD9RTUBsP0FRO0Q6O0WyIxEIAAAAGHRSTlMADB8zSWF3krDDw8TJ1NbX5efv8ff9/fxKDJ9uAAAGKklEQVR42u2Z63qjOAyGC4RwCOfB2JAGqrSb2WnTw/1f3UaWcSGYNKTdf/P+mOkTrE+yJBulvfvLT2A5ruenaVHyIks33npl/6C4s/ZLAM45SOi/1FtZPyFur1OYofBX3w7d54Bxm+E8db+nDr12ttmESZ4zludJEG5S7TO72YPlKZFyE+YCYUJTBZsMiNS5Sd7NlDmKM2Eg2JQg8awbglfqgbhArjxkS7dgp2RH6hc9AMLdZYUtZN5DJr4molC8BfKrEkPKEnEVjLbgW1fLy77ZVOJagoIcLIl+IxaQZGjiX597HopF5CkaXVMDO9Pyix3AFV3kw4lQLCbHuMovz8FallbcQIJ5Ta0vks9RnolbCK84BtjKRS5uA43hYoZcOBGIG2Epbv6CvFVQ8m8loh66WNySsnN7htL58LNp+NXT8/PhXiBXPMjLSxtwp8W9f/1AngRierBkA+kk/IpUSOeKByzn8y3kAAAfh//0oXgV4roHm/kz4E2z//zRc3/lgwBzbM2mJxQEa5pqgX7d1L0htrhx7LKxOZlKbwcAWyEOWq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vPaz0IGcOvTHvUIlE2+prqAxLSQxZlU2stql1NqCCLdIiIN/i1DBEHUoElM9dBravbiAnKqgpi4IBkw+utSPIoBijDXJipSVV7MpOEJUAc5Qmm3BnUN+w3hteEieYKfRZSIUcXKMVf0u5wD4EwsUNVvZOtUT7A2GkffHjByWpHqvRBYrTV72a6j8zZ6W0DTE86Hn04bmyWX3Ri9WH7ZU6Q7h+ZHo0nHUAcsQvVhXRDZHChwiyi/hnPuOsSEF6Exk3o6Y9DT1eZ+6cASXk2Y9k+6EOQMDGm6WBK10wOQJCBwren86cPPWUcRAnTVjGcU1LBgs9FURiX/e6479yZcLwCBmTxiawEwrOcleuu12t3tbLv/N4RLYIBhYexm7Fcn4OJcn0+zc+s8/VfPeddZHAGN6TT8eGczHdR/Gts1/MzDkThr23zqrVfAMFT33Nx1RJsx1k5zuWILLnG/vsH+Fv5D4NTVcp1Gzo8AAAAAElFTkSuQmCC&labelColor=white)](https://huggingface.co/spaces/opendatalab/MinerU)
[![ModelScope](https://img.shields.io/badge/Demo_on_ModelScope-purple?logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIzIiBoZWlnaHQ9IjIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCiA8Zz4KICA8dGl0bGU+TGF5ZXIgMTwvdGl0bGU+CiAgPHBhdGggaWQ9InN2Z18xNCIgZmlsbD0iIzYyNGFmZiIgZD0ibTAsODkuODRsMjUuNjUsMGwwLDI1LjY0OTk5bC0yNS42NSwwbDAsLTI1LjY0OTk5eiIvPgogIDxwYXRoIGlkPSJzdmdfMTUiIGZpbGw9IiM2MjRhZmYiIGQ9Im05OS4xNCwxMTUuNDlsMjUuNjUsMGwwLDI1LjY1bC0yNS42NSwwbDAsLTI1LjY1eiIvPgogIDxwYXRoIGlkPSJzdmdfMTYiIGZpbGw9IiM2MjRhZmYiIGQ9Im0xNzYuMDksMTQxLjE0bC0yNS42NDk5OSwwbDAsMjIuMTlsN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MjIuMTksMGwwLDQ3Ljg0bDQ3Ljg0LDBsMCwtMjIuMTlsLTI1LjY1LDBsMCwtMjUuNjV6Ii8+CiA8L2c+Cjwvc3ZnPg==&labelColor=white)](https://www.modelscope.cn/studios/OpenDataLab/MinerU)
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/gist/papayalove/b5f4913389e7ff9883c6b687de156e78/mineru_demo.ipynb)
- [![Paper](https://img.shields.io/badge/Paper-arXiv-green)](https://arxiv.org/pdf/2409.18839?)
++
+ [![Paper](https://img.shields.io/badge/Paper-arXiv-green)](https://arxiv.org/abs/2409.18839)
+
+
<a href="https://trendshift.io/repositories/11174" target="_blank"><img src="https://trendshift.io/api/badge/repositories/11174" alt="opendatalab%2FMinerU | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
<!-- language -->
@@@ -226,6 -207,6 +228,7 @@@ You can find the `magic-pdf.json` file
You can modify certain configurations in this file to enable or disable features, such as table recognition:
++
> If the following items are not present in the JSON, please manually add the required items and remove the comment content (standard JSON does not support comments).
```json
diff --cc README_zh-CN.md
index 0bea8556,7b4c4e89..783f8963
--- a/README_zh-CN.md
+++ b/README_zh-CN.md
@@@ -18,8 -18,8 +18,9 @@@
[![ModelScope](https://img.shields.io/badge/Demo_on_ModelScope-purple?logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIzIiBoZWlnaHQ9IjIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCiA8Zz4KICA8dGl0bGU+TGF5ZXIgMTwvdGl0bGU+CiAgPHBhdGggaWQ9InN2Z18xNCIgZmlsbD0iIzYyNGFmZiIgZD0ibTAsODkuODRsMjUuNjUsMGwwLDI1LjY0OTk5bC0yNS42NSwwbDAsLTI1LjY0OTk5eiIvPgogIDxwYXRoIGlkPSJzdmdfMTUiIGZpbGw9IiM2MjRhZmYiIGQ9Im05OS4xNCwxMTUuNDlsMjUuNjUsMGwwLDI1LjY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4xOWwtNDcuODQsMGwwLDQ3Ljg0bDIyLjE5LDBsMCwtMjUuNjV6Ii8+CiAgPHBhdGggaWQ9InN2Z18yNCIgZmlsbD0iIzYyNGFmZiIgZD0ibTQ3Ljg0LDExNS40OWwtMjIuMTksMGwwLDQ3Ljg0bDQ3Ljg0LDBsMCwtMjIuMTlsLTI1LjY1LDBsMCwtMjUuNjV6Ii8+CiA8L2c+Cjwvc3ZnPg==&labelColor=white)](https://www.modelscope.cn/studios/OpenDataLab/MinerU)
[![HuggingFace](https://img.shields.io/badge/Demo_on_HuggingFace-yellow.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAABYCAMAAACkl9t/AAAAk1BMVEVHcEz/nQv/nQv/nQr/nQv/nQr/nQv/nQv/nQr/wRf/txT/pg7/yRr/rBD/zRz/ngv/oAz/zhz/nwv/txT/ngv/0B3+zBz/nQv/0h7/wxn/vRb/thXkuiT/rxH/pxD/ogzcqyf/nQvTlSz/czCxky7/SjifdjT/Mj3+Mj3wMj15aTnDNz+DSD9RTUBsP0FRO0Q6O0WyIxEIAAAAGHRSTlMADB8zSWF3krDDw8TJ1NbX5efv8ff9/fxKDJ9uAAAGKklEQVR42u2Z63qjOAyGC4RwCOfB2JAGqrSb2WnTw/1f3UaWcSGYNKTdf/P+mOkTrE+yJBulvfvLT2A5ruenaVHyIks33npl/6C4s/ZLAM45SOi/1FtZPyFur1OYofBX3w7d54Bxm+E8db+nDr12ttmESZ4zludJEG5S7TO72YPlKZFyE+YCYUJTBZsMiNS5Sd7NlDmKM2Eg2JQg8awbglfqgbhArjxkS7dgp2RH6hc9AMLdZYUtZN5DJr4molC8BfKrEkPKEnEVjLbgW1fLy77ZVOJagoIcLIl+IxaQZGjiX597HopF5CkaXVMDO9Pyix3AFV3kw4lQLCbHuMovz8FallbcQIJ5Ta0vks9RnolbCK84BtjKRS5uA43hYoZcOBGIG2Epbv6CvFVQ8m8loh66WNySsnN7htL58LNp+NXT8/PhXiBXPMjL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0AikimGDbqmyT8P8NOYiqrldF8rX+YN7TopX4UoHuSCYY7cgX4gHwclQKl1zhx0THf+tCAUValzjI7Wg9EhptrkIcfIJjA94evOn8B2eHaVzvBrnl2ig0So6hvPaz0IGcOvTHvUIlE2+prqAxLSQxZlU2stql1NqCCLdIiIN/i1DBEHUoElM9dBravbiAnKqgpi4IBkw+utSPIoBijDXJipSVV7MpOEJUAc5Qmm3BnUN+w3hteEieYKfRZSIUcXKMVf0u5wD4EwsUNVvZOtUT7A2GkffHjByWpHqvRBYrTV72a6j8zZ6W0DTE86Hn04bmyWX3Ri9WH7ZU6Q7h+ZHo0nHUAcsQvVhXRDZHChwiyi/hnPuOsSEF6Exk3o6Y9DT1eZ+6cASXk2Y9k+6EOQMDGm6WBK10wOQJCBwren86cPPWUcRAnTVjGcU1LBgs9FURiX/e6479yZcLwCBmTxiawEwrOcleuu12t3tbLv/N4RLYIBhYexm7Fcn4OJcn0+zc+s8/VfPeddZHAGN6TT8eGczHdR/Gts1/MzDkThr23zqrVfAMFT33Nx1RJsx1k5zuWILLnG/vsH+Fv5D4NTVcp1Gzo8AAAAAElFTkSuQmCC&labelColor=white)](https://huggingface.co/spaces/opendatalab/MinerU)
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/gist/papayalove/b5f4913389e7ff9883c6b687de156e78/mineru_demo.ipynb)
- [![Paper](https://img.shields.io/badge/Paper-arXiv-green)](https://arxiv.org/pdf/2409.18839?)
+ [![Paper](https://img.shields.io/badge/Paper-arXiv-green)](https://arxiv.org/abs/2409.18839)
+
+
<a href="https://trendshift.io/repositories/11174" target="_blank"><img src="https://trendshift.io/api/badge/repositories/11174" alt="opendatalab%2FMinerU | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
<!-- language -->
diff --cc docs/README_Ubuntu_CUDA_Acceleration_en_US.md
index 010cc729,066bbd72..45abe97b
--- a/docs/README_Ubuntu_CUDA_Acceleration_en_US.md
+++ b/docs/README_Ubuntu_CUDA_Acceleration_en_US.md
@@@ -1,97 -1,76 +1,100 @@@
# Ubuntu 22.04 LTS
### 1. Check if NVIDIA Drivers Are Installed
- ```sh
- nvidia-smi
- ```
- If you see information similar to the following, it means that the NVIDIA drivers are already installed, and you can skip Step 2.
- ```plaintext
- +---------------------------------------------------------------------------------------+
- | NVIDIA-SMI 537.34 Driver Version: 537.34 CUDA Version: 12.2 |
- |-----------------------------------------+----------------------+----------------------+
- | GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
- | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
- | | | MIG M. |
- |=========================================+======================+======================|
- | 0 NVIDIA GeForce RTX 3060 Ti WDDM | 00000000:01:00.0 On | N/A |
- | 0% 51C P8 12W / 200W | 1489MiB / 8192MiB | 5% Default |
- | | | N/A |
- +-----------------------------------------+----------------------+----------------------+
- ```
+
+```sh
+nvidia-smi
+```
+
+If you see information similar to the following, it means that the NVIDIA drivers are already installed, and you can skip Step 2.
+
+Notice:`CUDA Version` should be >= 12.1, If the displayed version number is less than 12.1, please upgrade the driver.
+
+```plaintext
++---------------------------------------------------------------------------------------+
+| NVIDIA-SMI 537.34 Driver Version: 537.34 CUDA Version: 12.2 |
+|-----------------------------------------+----------------------+----------------------+
+| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
+| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
+| | | MIG M. |
+|=========================================+======================+======================|
+| 0 NVIDIA GeForce RTX 3060 Ti WDDM | 00000000:01:00.0 On | N/A |
+| 0% 51C P8 12W / 200W | 1489MiB / 8192MiB | 5% Default |
+| | | N/A |
++-----------------------------------------+----------------------+----------------------+
+```
### 2. Install the Driver
- If no driver is installed, use the following command:
- ```sh
- sudo apt-get update
- sudo apt-get install nvidia-driver-545
- ```
- Install the proprietary driver and restart your computer after installation.
- ```sh
- reboot
- ```
+
+If no driver is installed, use the following command:
+
+```sh
+sudo apt-get update
+sudo apt-get install nvidia-driver-545
+```
+
+Install the proprietary driver and restart your computer after installation.
+
+```sh
+reboot
+```
### 3. Install Anaconda
- If Anaconda is already installed, skip this step.
- ```sh
- wget https://repo.anaconda.com/archive/Anaconda3-2024.06-1-Linux-x86_64.sh
- bash Anaconda3-2024.06-1-Linux-x86_64.sh
- ```
- In the final step, enter `yes`, close the terminal, and reopen it.
+
+If Anaconda is already installed, skip this step.
+
+```sh
+wget https://repo.anaconda.com/archive/Anaconda3-2024.06-1-Linux-x86_64.sh
+bash Anaconda3-2024.06-1-Linux-x86_64.sh
+```
+
+In the final step, enter `yes`, close the terminal, and reopen it.
### 4. Create an Environment Using Conda
- Specify Python version 3.10.
- ```sh
- conda create -n MinerU python=3.10
- conda activate MinerU
- ```
+
+Specify Python version 3.10.
+
+```sh
+conda create -n MinerU python=3.10
+conda activate MinerU
+```
### 5. Install Applications
- ```sh
- pip install -U magic-pdf[full] --extra-index-url https://wheels.myhloli.com
- ```
+
+```sh
+pip install -U magic-pdf[full] --extra-index-url https://wheels.myhloli.com
+```
+
❗ After installation, make sure to check the version of `magic-pdf` using the following command:
- ```sh
- magic-pdf --version
- ```
- If the version number is less than 0.7.0, please report the issue.
+
+```sh
+magic-pdf --version
+```
+
+If the version number is less than 0.7.0, please report the issue.
### 6. Download Models
- Refer to detailed instructions on [how to download model files](how_to_download_models_en.md).
+
++
+Refer to detailed instructions on [how to download model files](how_to_download_models_en.md).
+
+
## 7. Understand the Location of the Configuration File
After completing the [6. Download Models](#6-download-models) step, the script will automatically generate a `magic-pdf.json` file in the user directory and configure the default model path.
You can find the `magic-pdf.json` file in your user directory.
+
> The user directory for Linux is "/home/username".
++
### 8. First Run
- Download a sample file from the repository and test it.
- ```sh
- wget https://github.com/opendatalab/MinerU/raw/master/demo/small_ocr.pdf
- magic-pdf -p small_ocr.pdf
- ```
+
+Download a sample file from the repository and test it.
+
+```sh
+wget https://github.com/opendatalab/MinerU/raw/master/demo/small_ocr.pdf
+magic-pdf -p small_ocr.pdf
+```
### 9. Test CUDA Acceleration
diff --cc docs/README_Ubuntu_CUDA_Acceleration_zh_CN.md
index e64b0220,50eb2da7..e685051a
--- a/docs/README_Ubuntu_CUDA_Acceleration_zh_CN.md
+++ b/docs/README_Ubuntu_CUDA_Acceleration_zh_CN.md
@@@ -75,14 -53,11 +75,16 @@@ pip install -U magic-pdf[full] --extra-
> 如果版本号小于0.7.0,请到issue中向我们反馈
## 6. 下载模型
+
++
详细参考 [如何下载模型文件](how_to_download_models_zh_cn.md)
## 7. 了解配置文件存放的位置
+
完成[6.下载模型](#6-下载模型)步骤后,脚本会自动生成用户目录下的magic-pdf.json文件,并自动配置默认模型路径。
-您可在【用户目录】下找到magic-pdf.json文件。
+您可在【用户目录】下找到magic-pdf.json文件。
+
++
> linux用户目录为 "/home/用户名"
## 8. 第一次运行
diff --cc docs/README_Windows_CUDA_Acceleration_en_US.md
index e258011d,e74bfee1..5a911895
--- a/docs/README_Windows_CUDA_Acceleration_en_US.md
+++ b/docs/README_Windows_CUDA_Acceleration_en_US.md
@@@ -48,53 -37,43 +48,54 @@@ You can find the `magic-pdf.json` file
> The user directory for Windows is "C:/Users/username".
### 7. First Run
- Download a sample file from the repository and test it.
- ```powershell
- (New-Object System.Net.WebClient).DownloadFile('https://github.com/opendatalab/MinerU/raw/master/demo/small_ocr.pdf', 'small_ocr.pdf')
- magic-pdf -p small_ocr.pdf
- ```
+
+Download a sample file from the repository and test it.
+
+```powershell
+ wget https://github.com/opendatalab/MinerU/raw/master/demo/small_ocr.pdf -O small_ocr.pdf
+ magic-pdf -p small_ocr.pdf
+```
### 8. Test CUDA Acceleration
- If your graphics card has at least 8GB of VRAM, follow these steps to test CUDA-accelerated parsing performance.
- 1. **Overwrite the installation of torch and torchvision** supporting CUDA.
- ```
- pip install --force-reinstall torch==2.3.1 torchvision==0.18.1 --index-url https://download.pytorch.org/whl/cu118
- ```
- >❗️Ensure the following versions are specified in the command:
- >```
- > torch==2.3.1 torchvision==0.18.1
- >```
- >These are the highest versions we support. Installing higher versions without specifying them will cause the program to fail.
- 2. **Modify the value of `"device-mode"`** in the `magic-pdf.json` configuration file located in your user directory.
-
- ```json
- {
- "device-mode": "cuda"
- }
- ```
- 3. **Run the following command to test CUDA acceleration**:
-
- ```
- magic-pdf -p small_ocr.pdf
- ```
+
+If your graphics card has at least 8GB of VRAM, follow these steps to test CUDA-accelerated parsing performance.
+
+1. **Overwrite the installation of torch and torchvision** supporting CUDA.
+
+ ```
+ pip install --force-reinstall torch==2.3.1 torchvision==0.18.1 --index-url https://download.pytorch.org/whl/cu118
+ ```
+
+ > ❗️Ensure the following versions are specified in the command:
+ >
+ > ```
+ > torch==2.3.1 torchvision==0.18.1
+ > ```
+ >
+ > These are the highest versions we support. Installing higher versions without specifying them will cause the program to fail.
+
+2. **Modify the value of `"device-mode"`** in the `magic-pdf.json` configuration file located in your user directory.
+
+ ```json
+ {
+ "device-mode": "cuda"
+ }
+ ```
+
++
+3. **Run the following command to test CUDA acceleration**:
+
+ ```
+ magic-pdf -p small_ocr.pdf
+ ```
### 9. Enable CUDA Acceleration for OCR
- >❗️This operation requires at least 16GB of VRAM on your graphics card, otherwise it will cause the program to crash or slow down.
- 1. **Download paddlepaddle-gpu**, which will automatically enable OCR acceleration upon installation.
- ```
- pip install paddlepaddle-gpu==2.6.1
- ```
- 2. **Run the following command to test OCR acceleration**:
- ```
- magic-pdf -p small_ocr.pdf
- ```
+
+1. **Download paddlepaddle-gpu**, which will automatically enable OCR acceleration upon installation.
+ ```
+ pip install paddlepaddle-gpu==2.6.1
+ ```
+2. **Run the following command to test OCR acceleration**:
+ ```
+ magic-pdf -p small_ocr.pdf
+ ```
diff --cc docs/README_Windows_CUDA_Acceleration_zh_CN.md
index a8647aac,11218551..8ac72787
--- a/docs/README_Windows_CUDA_Acceleration_zh_CN.md
+++ b/docs/README_Windows_CUDA_Acceleration_zh_CN.md
@@@ -42,10 -33,8 +42,11 @@@ pip install -U magic-pdf[full] --extra-
详细参考 [如何下载模型文件](how_to_download_models_zh_cn.md)
## 6. 了解配置文件存放的位置
+
完成[5.下载模型](#5-下载模型)步骤后,脚本会自动生成用户目录下的magic-pdf.json文件,并自动配置默认模型路径。
您可在【用户目录】下找到magic-pdf.json文件。
+
++
> windows用户目录为 "C:/Users/用户名"
## 7. 第一次运行
diff --cc docs/download_models.py
index ed1ee5c3,6b864eb6..6c79db19
--- a/docs/download_models.py
+++ b/docs/download_models.py
@@@ -1,7 -1,6 +1,8 @@@
++
+import json
import os
+
import requests
-import json
from modelscope import snapshot_download
@@@ -15,12 -7,14 +16,13 @@@ def download_json(url)
def download_and_modify_json(url, local_filename, modifications):
if os.path.exists(local_filename):
data = json.load(open(local_filename))
+ config_version = data.get('config_version', '0.0.0')
+ if config_version < '1.0.0':
+ data = download_json(url)
else:
- # 下载JSON文件
- response = requests.get(url)
- response.raise_for_status() # 检查请求是否成功
+ data = download_json(url)
- # 解析JSON内容
- data = response.json()
+
# 修改内容
for key, value in modifications.items():
data[key] = value
@@@ -31,23 -25,15 +33,25 @@@
if __name__ == '__main__':
- model_dir = snapshot_download('opendatalab/PDF-Extract-Kit')
++
+ mineru_patterns = [
+ "models/Layout/LayoutLMv3/*",
+ "models/Layout/YOLO/*",
+ "models/MFD/YOLO/*",
+ "models/MFR/unimernet_small/*",
+ "models/TabRec/TableMaster/*",
+ "models/TabRec/StructEqTable/*",
+ ]
+ model_dir = snapshot_download('opendatalab/PDF-Extract-Kit-1.0', allow_patterns=mineru_patterns)
layoutreader_model_dir = snapshot_download('ppaanngggg/layoutreader')
- model_dir = model_dir + "/models"
- print(f"model_dir is: {model_dir}")
- print(f"layoutreader_model_dir is: {layoutreader_model_dir}")
+ model_dir = model_dir + '/models'
+ print(f'model_dir is: {model_dir}')
+ print(f'layoutreader_model_dir is: {layoutreader_model_dir}')
+
+ json_url = 'https://gitee.com/myhloli/MinerU/raw/dev/magic-pdf.template.json'
+ config_file_name = 'magic-pdf.json'
+ home_dir = os.path.expanduser('~')
+
- json_url = 'https://gitee.com/myhloli/MinerU/raw/master/magic-pdf.template.json'
- config_file_name = "magic-pdf.json"
- home_dir = os.path.expanduser("~")
config_file = os.path.join(home_dir, config_file_name)
json_mods = {
@@@ -56,4 -42,4 +60,6 @@@
}
download_and_modify_json(json_url, config_file, json_mods)
- print(f"The configuration file has been configured successfully, the path is: {config_file}")
++
+ print(f'The configuration file has been configured successfully, the path is: {config_file}')
++
diff --cc docs/download_models_hf.py
index 5e6b8dce,0aa28bad..9dfda1e5
--- a/docs/download_models_hf.py
+++ b/docs/download_models_hf.py
@@@ -15,12 -7,14 +15,13 @@@ def download_json(url)
def download_and_modify_json(url, local_filename, modifications):
if os.path.exists(local_filename):
data = json.load(open(local_filename))
+ config_version = data.get('config_version', '0.0.0')
+ if config_version < '1.0.0':
+ data = download_json(url)
else:
- # 下载JSON文件
- response = requests.get(url)
- response.raise_for_status() # 检查请求是否成功
+ data = download_json(url)
- # 解析JSON内容
- data = response.json()
+
# 修改内容
for key, value in modifications.items():
data[key] = value
@@@ -31,30 -25,15 +32,31 @@@
if __name__ == '__main__':
- model_dir = snapshot_download('opendatalab/PDF-Extract-Kit')
- layoutreader_model_dir = snapshot_download('hantian/layoutreader')
- model_dir = model_dir + "/models"
- print(f"model_dir is: {model_dir}")
- print(f"layoutreader_model_dir is: {layoutreader_model_dir}")
-
- json_url = 'https://github.com/opendatalab/MinerU/raw/master/magic-pdf.template.json'
- config_file_name = "magic-pdf.json"
- home_dir = os.path.expanduser("~")
+
+ mineru_patterns = [
+ "models/Layout/LayoutLMv3/*",
+ "models/Layout/YOLO/*",
+ "models/MFD/YOLO/*",
+ "models/MFR/unimernet_small/*",
+ "models/TabRec/TableMaster/*",
+ "models/TabRec/StructEqTable/*",
+ ]
+ model_dir = snapshot_download('opendatalab/PDF-Extract-Kit-1.0', allow_patterns=mineru_patterns)
+
+ layoutreader_pattern = [
+ "*.json",
+ "*.safetensors",
+ ]
+ layoutreader_model_dir = snapshot_download('hantian/layoutreader', allow_patterns=layoutreader_pattern)
+
+ model_dir = model_dir + '/models'
+ print(f'model_dir is: {model_dir}')
+ print(f'layoutreader_model_dir is: {layoutreader_model_dir}')
+
+ json_url = 'https://github.com/opendatalab/MinerU/raw/dev/magic-pdf.template.json'
+ config_file_name = 'magic-pdf.json'
+ home_dir = os.path.expanduser('~')
++
config_file = os.path.join(home_dir, config_file_name)
json_mods = {
@@@ -63,4 -42,4 +65,6 @@@
}
download_and_modify_json(json_url, config_file, json_mods)
- print(f"The configuration file has been configured successfully, the path is: {config_file}")
++
+ print(f'The configuration file has been configured successfully, the path is: {config_file}')
++
diff --cc docs/how_to_download_models_en.md
index 34dd54e4,2f7c9fa0..6e31f524
--- a/docs/how_to_download_models_en.md
+++ b/docs/how_to_download_models_en.md
@@@ -1,11 -1,10 +1,11 @@@
Model downloads are divided into initial downloads and updates to the model directory. Please refer to the corresponding documentation for instructions on how to proceed.
+
# Initial download of model files
--### 1. Download the Model from Hugging Face
++### Download the Model from Hugging Face
+
Use a Python Script to Download Model Files from Hugging Face
-
```bash
pip install huggingface_hub
wget https://github.com/opendatalab/MinerU/raw/master/docs/download_models_hf.py -O download_models_hf.py
@@@ -16,6 -14,6 +15,7 @@@ The Python script will automatically do
The configuration file can be found in the user directory, with the filename `magic-pdf.json`.
++
# How to update models previously downloaded
## 1. Models downloaded via Git LFS
diff --cc docs/how_to_download_models_zh_cn.md
index 9b395e34,54fc5782..25963d60
--- a/docs/how_to_download_models_zh_cn.md
+++ b/docs/how_to_download_models_zh_cn.md
@@@ -10,6 -10,7 +10,7 @@@
<pre><code>pip install huggingface_hub
wget https://gitee.com/myhloli/MinerU/raw/master/docs/download_models_hf.py -O download_models_hf.py
python download_models_hf.py</code></pre>
- <p>python脚本执行完毕后,会输出模型下载目录</p>
++ <p>python脚本会自动下载模型文件并配置好配置文件中的模型目录</p>
</details>
## 方法二:从 ModelScope 下载模型
@@@ -24,10 -25,9 +25,10 @@@ python download_models.p
python脚本会自动下载模型文件并配置好配置文件中的模型目录
配置文件可以在用户目录中找到,文件名为`magic-pdf.json`
+
> windows的用户目录为 "C:\\Users\\用户名", linux用户目录为 "/home/用户名", macOS用户目录为 "/Users/用户名"
+
# 此前下载过模型,如何更新
## 1. 通过git lfs下载过模型