From 60b4bd459e0317be096f142620b5984576f790df Mon Sep 17 00:00:00 2001 From: xu rui Date: Mon, 11 Nov 2024 17:06:08 +0800 Subject: [PATCH 1/4] feat: 1. add link to the readthedocs --- README.md | 2 + README_zh-CN.md | 2 + next_docs/en/_static/image/ReadTheDocs.svg | 18 +++++ .../en/user_guide/install/boost_with_cuda.rst | 63 +++++++++------- next_docs/en/user_guide/install/install.rst | 41 ++++++----- next_docs/zh_cn/_static/image/ReadTheDocs.svg | 18 +++++ .../user_guide/install/boost_with_cuda.rst | 73 +++++++++++++------ .../zh_cn/user_guide/install/install.rst | 12 +-- 8 files changed, 156 insertions(+), 73 deletions(-) create mode 100644 next_docs/en/_static/image/ReadTheDocs.svg create mode 100644 next_docs/zh_cn/_static/image/ReadTheDocs.svg diff --git a/README.md b/README.md index 0f35b91f..c589ef22 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ + +

diff --git a/README_zh-CN.md b/README_zh-CN.md index 04f79e4b..12403631 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -1,3 +1,5 @@ + +

diff --git a/next_docs/en/_static/image/ReadTheDocs.svg b/next_docs/en/_static/image/ReadTheDocs.svg new file mode 100644 index 00000000..26f0dc18 --- /dev/null +++ b/next_docs/en/_static/image/ReadTheDocs.svg @@ -0,0 +1,18 @@ + + + +Created with Fabric.js 5.2.4 + + + + + + + + + + + + Read The Docs + + \ No newline at end of file diff --git a/next_docs/en/user_guide/install/boost_with_cuda.rst b/next_docs/en/user_guide/install/boost_with_cuda.rst index 58b9194d..b6cbfce1 100644 --- a/next_docs/en/user_guide/install/boost_with_cuda.rst +++ b/next_docs/en/user_guide/install/boost_with_cuda.rst @@ -9,16 +9,18 @@ appropriate guide based on your system: - :ref:`ubuntu_22_04_lts_section` - :ref:`windows_10_or_11_section` +- Quick Deployment with Docker -- Quick Deployment with Docker > Docker requires a GPU with at least - 16GB of VRAM, and all acceleration features are enabled by default. +.. admonition:: Important + :class: tip -.. note:: + Docker requires a GPU with at least 16GB of VRAM, and all acceleration features are enabled by default. - Before running this Docker, you can use the following command to - check if your device supports CUDA acceleration on Docker. + Before running this Docker, you can use the following command to check if your device supports CUDA acceleration on Docker. - bash docker run --rm --gpus=all nvidia/cuda:12.1.0-base-ubuntu22.04 nvidia-smi + .. code-block:: bash + + bash docker run --rm --gpus=all nvidia/cuda:12.1.0-base-ubuntu22.04 nvidia-smi .. code:: sh @@ -42,8 +44,9 @@ Ubuntu 22.04 LTS 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. +.. note:: + + ``CUDA Version`` should be >= 12.1, If the displayed version number is less than 12.1, please upgrade the driver. .. code:: text @@ -105,8 +108,10 @@ Specify Python version 3.10. 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: +.. admonition:: Important + :class: tip + + ❗ After installation, make sure to check the version of ``magic-pdf`` using the following command: .. code:: sh @@ -127,7 +132,10 @@ 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”. +.. admonition:: TIP + :class: tip + + The user directory for Linux is “/home/username”. 8. First Run ~~~~~~~~~~~~ @@ -216,16 +224,16 @@ Python version must be 3.10. pip install -U magic-pdf[full] --extra-index-url https://wheels.myhloli.com -.. +.. admonition:: Important + :class: tip - ❗️After installation, verify the version of ``magic-pdf``: + ❗️After installation, verify the version of ``magic-pdf``: - .. code:: bash + .. code:: bash magic-pdf --version - If the version number is less than 0.7.0, please report it in the - issues section. + If the version number is less than 0.7.0, please report it in the issues section. 5. Download Models ~~~~~~~~~~~~~~~~~~ @@ -240,7 +248,10 @@ 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 Windows is “C:/Users/username”. +.. admonition:: Tip + :class: tip + + The user directory for Windows is “C:/Users/username”. 7. First Run ~~~~~~~~~~~~ @@ -258,23 +269,23 @@ Download a sample file from the repository and test it. 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. +1. **Overwrite the installation of torch and torchvision** supporting CUDA. - :: +.. code:: sh - pip install --force-reinstall torch==2.3.1 torchvision==0.18.1 --index-url https://download.pytorch.org/whl/cu118 + pip install --force-reinstall torch==2.3.1 torchvision==0.18.1 --index-url https://download.pytorch.org/whl/cu118 - .. +.. admonition:: Important + :class: tip - ❗️Ensure the following versions are specified in the command: + ❗️Ensure the following versions are specified in the command: - :: + + .. code:: sh 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. + 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. diff --git a/next_docs/en/user_guide/install/install.rst b/next_docs/en/user_guide/install/install.rst index c5302ead..70f8edf1 100644 --- a/next_docs/en/user_guide/install/install.rst +++ b/next_docs/en/user_guide/install/install.rst @@ -4,25 +4,28 @@ Install If you encounter any installation issues, please first consult the :doc:`../../additional_notes/faq`. If the parsing results are not as expected, refer to the :doc:`../../additional_notes/known_issues`. -Pre-installation Notice—Hardware and Software Environment Support ------------------------------------------------------------------- - -To ensure the stability and reliability of the project, we only optimize -and test for specific hardware and software environments during -development. This ensures that users deploying and running the project -on recommended system configurations will get the best performance with -the fewest compatibility issues. - -By focusing resources on the mainline environment, our team can more -efficiently resolve potential bugs and develop new features. - -In non-mainline environments, due to the diversity of hardware and -software configurations, as well as third-party dependency compatibility -issues, we cannot guarantee 100% project availability. Therefore, for -users who wish to use this project in non-recommended environments, we -suggest carefully reading the documentation and FAQ first. Most issues -already have corresponding solutions in the FAQ. We also encourage -community feedback to help us gradually expand support. + +.. admonition:: Warning + :class: tip + + **Pre-installation Notice—Hardware and Software Environment Support** + + To ensure the stability and reliability of the project, we only optimize + and test for specific hardware and software environments during + development. This ensures that users deploying and running the project + on recommended system configurations will get the best performance with + the fewest compatibility issues. + + By focusing resources on the mainline environment, our team can more + efficiently resolve potential bugs and develop new features. + + In non-mainline environments, due to the diversity of hardware and + software configurations, as well as third-party dependency compatibility + issues, we cannot guarantee 100% project availability. Therefore, for + users who wish to use this project in non-recommended environments, we + suggest carefully reading the documentation and FAQ first. Most issues + already have corresponding solutions in the FAQ. We also encourage + community feedback to help us gradually expand support. .. raw:: html diff --git a/next_docs/zh_cn/_static/image/ReadTheDocs.svg b/next_docs/zh_cn/_static/image/ReadTheDocs.svg new file mode 100644 index 00000000..26f0dc18 --- /dev/null +++ b/next_docs/zh_cn/_static/image/ReadTheDocs.svg @@ -0,0 +1,18 @@ + + + +Created with Fabric.js 5.2.4 + + + + + + + + + + + + Read The Docs + + \ No newline at end of file diff --git a/next_docs/zh_cn/user_guide/install/boost_with_cuda.rst b/next_docs/zh_cn/user_guide/install/boost_with_cuda.rst index caef132e..9a118a8a 100644 --- a/next_docs/zh_cn/user_guide/install/boost_with_cuda.rst +++ b/next_docs/zh_cn/user_guide/install/boost_with_cuda.rst @@ -5,14 +5,16 @@ - :ref:`ubuntu_22_04_lts_section` - :ref:`windows_10_or_11_section` - +- 使用 Docker 快速部署 + .. admonition:: Important - :class: warning + :class: tip - 使用 Docker 快速部署 > Docker 需要至少 16GB 显存的 GPU,并且所有加速功能默认启用。 - 在运行此 Docker 容器之前,您可以使用以下命令检查您的设备是否支持 Docker 上的 CUDA 加速。 + Docker 需要至少 16GB 显存的 GPU,并且所有加速功能默认启用。 + + 在运行此 Docker 容器之前,您可以使用以下命令检查您的设备是否支持 Docker 上的 CUDA 加速。 - .. code-block:: sh + .. code-block:: sh bash docker run --rm --gpus=all nvidia/cuda:12.1.0-base-ubuntu22.04 nvidia-smi @@ -26,7 +28,7 @@ .. _ubuntu_22_04_lts_section: -Ubuntu 22.04 LT +Ubuntu 22.04 LTS ---------------- 1.检查 NVIDIA 驱动程序是否已安装 @@ -37,7 +39,9 @@ Ubuntu 22.04 LT 如果您看到类似以下的信息,则表示 NVIDIA 驱动程序已安装,可以跳过第 2 步。 -注意:“CUDA 版本”应 >= 12.1,如果显示的版本号小于 12.1,请升级驱动程序。 +.. note:: + + ``CUDA 版本`` 应 >= 12.1,如果显示的版本号小于 12.1,请升级驱动程序。 .. code:: text @@ -99,7 +103,10 @@ Ubuntu 22.04 LT pip install -U magic-pdf[full] --extra-index-url https://wheels.myhloli.com -❗ 安装完成后,请确保使用以下命令检查 ``magic-pdf`` 的版本: +.. admonition:: Important + :class: tip + + ❗ 安装完成后,请确保使用以下命令检查 ``magic-pdf`` 的版本: .. code:: sh @@ -117,7 +124,10 @@ Ubuntu 22.04 LT 完成 `6. 下载模型 <#6-download-models>`__ 步骤后,脚本将自动在用户目录中生成一个 ``magic-pdf.json`` 文件并配置默认模型路径。您可以在用户目录中找到 ``magic-pdf.json`` 文件。 - Linux 用户目录是 “/home/用户名”。 +.. admonition:: Tip + :class: tip + + Linux 用户目录是 “/home/用户名”。 8. 首次运行 ~~~~~~~~~~~~ @@ -148,6 +158,11 @@ Ubuntu 22.04 LT magic-pdf -p small_ocr.pdf -o ./output +.. admonition:: Tip + :class: tip + + CUDA加速是否生效可以根据log中输出的各个阶段cost耗时来简单判断,通常情况下,``layout detection cost`` 和 ``mfr time`` 应提速10倍以上。 + 10. 启用 OCR 的 CUDA 加速 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -163,6 +178,11 @@ Ubuntu 22.04 LT magic-pdf -p small_ocr.pdf -o ./output +.. admonition:: Tip + :class: tip + + CUDA加速是否生效可以根据log中输出的各个阶段cost耗时来简单判断,通常情况下, ``ocr cost`` 应提速10倍以上。 + .. _windows_10_or_11_section: Windows 10/11 @@ -189,7 +209,7 @@ Windows 10/11 Python 版本必须是 3.10。 -:: +.. code:: bash conda create -n MinerU python=3.10 conda activate MinerU @@ -201,14 +221,16 @@ Python 版本必须是 3.10。 pip install -U magic-pdf[full] --extra-index-url https://wheels.myhloli.com +.. admonition:: Important + :class: tip -❗️安装完成后,请验证 ``magic-pdf`` 的版本: + ❗️安装完成后,请验证 ``magic-pdf`` 的版本: -.. code:: bash + .. code:: bash magic-pdf --version -如果版本号小于 0.7.0,请在问题部分报告。 + 如果版本号小于 0.7.0,请在问题部分报告。 5. 下载模型 ~~~~~~~~~~~~~~~~~~ @@ -220,7 +242,10 @@ Python 版本必须是 3.10。 完成 `5. 下载模型 <#5-download-models>__` 步骤后,脚本将自动在用户目录中生成一个 magic-pdf.json 文件并配置默认模型路径。您可以在【用户目录】中找到 magic-pdf.json 文件。 -Windows 用户目录是 “C:/Users/用户名”。 +.. admonition:: Tip + :class: tip + + Windows 用户目录是 “C:/Users/用户名”。 7. 首次运行 ~~~~~~~~~~ @@ -244,15 +269,16 @@ Windows 用户目录是 “C:/Users/用户名”。 pip install --force-reinstall torch==2.3.1 torchvision==0.18.1 --index-url https://download.pytorch.org/whl/cu118 -.. +.. admonition:: Important + :class: tip - ❗️务必在命令中指定以下版本 + ❗️务必在命令中指定以下版本 - .. code:: bash + .. code:: bash torch==2.3.1 torchvision==0.18.1 - 这是我们支持的最高版本,如果不指定版本会自动安装更高版本导致程序无法运行 + 这是我们支持的最高版本,如果不指定版本会自动安装更高版本导致程序无法运行 **2.修改【用户目录】中配置文件magic-pdf.json中”device-mode”的值** @@ -268,10 +294,10 @@ Windows 用户目录是 “C:/Users/用户名”。 magic-pdf -p small_ocr.pdf -o ./output -.. +.. admonition:: Tip + :class: tip - 提示:CUDA加速是否生效可以根据log中输出的各个阶段的耗时来简单判断,通常情况下,\ ``layout detection time`` - 和 ``mfr time`` 应提速10倍以上。 + 提示:CUDA加速是否生效可以根据log中输出的各个阶段的耗时来简单判断,通常情况下,\ ``layout detection time`` 和 ``mfr time`` 应提速10倍以上。 9. 为ocr开启cuda加速 ~~~~~~~~~~~~~~~~~~~~~~~ @@ -288,6 +314,7 @@ Windows 用户目录是 “C:/Users/用户名”。 magic-pdf -p small_ocr.pdf -o ./output -.. +.. admonition:: Tip + :class: tip -提示:CUDA加速是否生效可以根据log中输出的各个阶段cost耗时来简单判断,通常情况下,\ ``ocr time``\ 应提速10倍以上。 + 提示:CUDA加速是否生效可以根据log中输出的各个阶段cost耗时来简单判断,通常情况下,\ ``ocr time``\ 应提速10倍以上。 diff --git a/next_docs/zh_cn/user_guide/install/install.rst b/next_docs/zh_cn/user_guide/install/install.rst index 9c0b89e1..4b17d949 100644 --- a/next_docs/zh_cn/user_guide/install/install.rst +++ b/next_docs/zh_cn/user_guide/install/install.rst @@ -4,14 +4,16 @@ 如果您遇到任何安装问题,请首先查阅 :doc:`../../additional_notes/faq`。如果解析结果不如预期,可参考 :doc:`../../additional_notes/known_issues`。 -预安装须知—硬件和软件环境支持 ------------------------------ +.. admonition:: Warning + :class: tip -为了确保项目的稳定性和可靠性,在开发过程中我们仅对特定的硬件和软件环境进行了优化和测试。这确保了在推荐系统配置上部署和运行项目的用户能够获得最佳性能,并且兼容性问题最少。 + **预安装须知—硬件和软件环境支持** + + 为了确保项目的稳定性和可靠性,在开发过程中我们仅对特定的硬件和软件环境进行了优化和测试。这确保了在推荐系统配置上部署和运行项目的用户能够获得最佳性能,并且兼容性问题最少。 -通过将资源集中在主线环境中,我们的团队可以更高效地解决潜在的错误并开发新功能。 + 通过将资源集中在主线环境中,我们的团队可以更高效地解决潜在的错误并开发新功能。 -在非主线环境中,由于硬件和软件配置的多样性以及第三方依赖项的兼容性问题,我们无法保证100%的项目可用性。因此,对于希望在非推荐环境中使用该项目的用户,我们建议首先仔细阅读文档和常见问题解答。大多数问题在常见问题解答中已经有相应的解决方案。我们也鼓励社区反馈,以帮助我们逐步扩大支持。 + 在非主线环境中,由于硬件和软件配置的多样性以及第三方依赖项的兼容性问题,我们无法保证100%的项目可用性。因此,对于希望在非推荐环境中使用该项目的用户,我们建议首先仔细阅读文档和常见问题解答。大多数问题在常见问题解答中已经有相应的解决方案。我们也鼓励社区反馈,以帮助我们逐步扩大支持。 .. raw:: html From bd1d776bee10ed0428e4a39110d094a351144d1e Mon Sep 17 00:00:00 2001 From: xu rui Date: Mon, 11 Nov 2024 17:08:07 +0800 Subject: [PATCH 2/4] style: adjust logo size --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c589ef22..31c7f165 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - +

From ccd7566bf13a8a7249ab7ad830bfc895ad17945c Mon Sep 17 00:00:00 2001 From: xu rui Date: Mon, 11 Nov 2024 17:21:25 +0800 Subject: [PATCH 3/4] style: adjust logo size --- README.md | 5 ++++- next_docs/en/_static/image/ReadTheDocs.svg | 19 +++++++++++++------ next_docs/zh_cn/_static/image/ReadTheDocs.svg | 19 +++++++++++++------ 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 31c7f165..1aae470d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ - + +
+ +
diff --git a/next_docs/en/_static/image/ReadTheDocs.svg b/next_docs/en/_static/image/ReadTheDocs.svg index 26f0dc18..de907442 100644 --- a/next_docs/en/_static/image/ReadTheDocs.svg +++ b/next_docs/en/_static/image/ReadTheDocs.svg @@ -1,18 +1,25 @@ - + Created with Fabric.js 5.2.4 - - + + + - + - + - + Read The Docs + + + + + Read The Docs + \ No newline at end of file diff --git a/next_docs/zh_cn/_static/image/ReadTheDocs.svg b/next_docs/zh_cn/_static/image/ReadTheDocs.svg index 26f0dc18..de907442 100644 --- a/next_docs/zh_cn/_static/image/ReadTheDocs.svg +++ b/next_docs/zh_cn/_static/image/ReadTheDocs.svg @@ -1,18 +1,25 @@ - + Created with Fabric.js 5.2.4 - - + + + - + - + - + Read The Docs + + + + + Read The Docs + \ No newline at end of file From 7d0c4238db83e80289971c80b09e23a4388712ab Mon Sep 17 00:00:00 2001 From: xu rui Date: Mon, 11 Nov 2024 17:34:48 +0800 Subject: [PATCH 4/4] style: add read the docs link on the readme --- README.md | 11 ++++++----- README_zh-CN.md | 8 ++++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1aae470d..23de5c4c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,3 @@ - -
- -
-

@@ -43,6 +38,12 @@ 👋 join us on Discord and WeChat

+ + +

+ read more docs on Read The Docs +

+
# Changelog diff --git a/README_zh-CN.md b/README_zh-CN.md index 12403631..399035e6 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -1,5 +1,3 @@ - -

@@ -40,6 +38,12 @@ 👋 join us on Discord and WeChat

+ +

+ read more docs on Read The Docs +

+ +
# 更新记录