소스 검색

docs(README): update documentation for NPU support

- Add section for using NPU acceleration in both English and Chinese README files
- Update system requirements to include CANN environment for NPU support
- Enhance the "Quick Start" guide with NPU-related information- Modify hardware requirements to specify "Ascend 910b" for NPU acceleration
myhloli 10 달 전
부모
커밋
2e8601ab93
3개의 변경된 파일39개의 추가작업 그리고 336개의 파일을 삭제
  1. 21 4
      README.md
  2. 0 327
      README_ja-JP.md
  3. 18 5
      README_zh-CN.md

+ 21 - 4
README.md

@@ -81,6 +81,7 @@
             <li><a href="#online-demo">Online Demo</a></li>
             <li><a href="#quick-cpu-demo">Quick CPU Demo</a></li>
             <li><a href="#using-gpu">Using GPU</a></li>
+            <li><a href="#using-npu">Using NPU</a></li>
             </ul>
         </li>
         <li><a href="#usage">Usage</a>
@@ -129,7 +130,7 @@ https://github.com/user-attachments/assets/4bea02c9-6d54-4cd6-97ed-dff14340982c
 - OCR supports detection and recognition of 84 languages.
 - Supports multiple output formats, such as multimodal and NLP Markdown, JSON sorted by reading order, and rich intermediate formats.
 - Supports various visualization results, including layout visualization and span visualization, for efficient confirmation of output quality.
-- Supports both CPU and GPU environments.
+- Supports running in a pure CPU environment, and also supports GPU/NPU acceleration
 - Compatible with Windows, Linux, and Mac platforms.
 
 ## Quick Start
@@ -141,6 +142,7 @@ There are three different ways to experience MinerU:
 - [Online Demo (No Installation Required)](#online-demo)
 - [Quick CPU Demo (Windows, Linux, Mac)](#quick-cpu-demo)
 - [Linux/Windows + CUDA](#Using-GPU)
+- [Linux + CANN](#using-npu)
 
 > [!WARNING]
 > **Pre-installation Notice—Hardware and Software Environment Support**
@@ -156,21 +158,25 @@ There are three different ways to experience MinerU:
         <td colspan="3" rowspan="2">Operating System</td>
     </tr>
     <tr>
-        <td>Ubuntu 22.04 LTS</td>
+        <td>Linux after 2019</td>
         <td>Windows 10 / 11</td>
         <td>macOS 11+</td>
     </tr>
     <tr>
         <td colspan="3">CPU</td>
-        <td>x86_64(unsupported ARM Linux)</td>
+        <td>x86_64 / arm64</td>
         <td>x86_64(unsupported ARM Windows)</td>
         <td>x86_64 / arm64</td>
     </tr>
     <tr>
-        <td colspan="3">Memory</td>
+        <td colspan="3">Memory Requirements</td>
         <td colspan="3">16GB or more, recommended 32GB+</td>
     </tr>
     <tr>
+        <td colspan="3">Storage Requirements</td>
+        <td colspan="3">20GB or more, with a preference for SSD</td>
+    </tr>
+    <tr>
         <td colspan="3">Python Version</td>
         <td colspan="3">3.10(Please make sure to create a Python 3.10 virtual environment using conda)</td>
     </tr>
@@ -187,6 +193,12 @@ There are three different ways to experience MinerU:
         <td>None</td>
     </tr>
     <tr>
+        <td colspan="3">CANN Environment(NPU support)</td>
+        <td>8.0+(Ascend 910b)</td>
+        <td>None</td>
+        <td>None</td>
+    </tr>
+    <tr>
         <td rowspan="2">GPU Hardware Support List</td>
         <td colspan="2">GPU VRAM 8GB or more</td>
         <td colspan="2">2080~2080Ti / 3060Ti~3090Ti / 4060~4090<br>
@@ -273,6 +285,11 @@ If your device supports CUDA and meets the GPU requirements of the mainline envi
   magic-pdf --help
   ```
 
+### Using NPU
+
+If your device has NPU acceleration hardware, you can follow the tutorial below to use NPU acceleration:
+
+
 ## Usage
 
 ### Command Line

+ 0 - 327
README_ja-JP.md

@@ -1,327 +0,0 @@
-> [!Warning]
-> このドキュメントはすでに古くなっています。最新版のドキュメントを参照してください:[ENGLISH](README.md)。
-<div id="top">
-
-<p align="center">
-  <img src="docs/images/MinerU-logo.png" width="300px" style="vertical-align:middle;">
-</p>
-
-</div>
-<div align="center">
-
-[![stars](https://img.shields.io/github/stars/opendatalab/MinerU.svg)](https://github.com/opendatalab/MinerU)
-[![forks](https://img.shields.io/github/forks/opendatalab/MinerU.svg)](https://github.com/opendatalab/MinerU)
-[![open issues](https://img.shields.io/github/issues-raw/opendatalab/MinerU)](https://github.com/opendatalab/MinerU/issues)
-[![issue resolution](https://img.shields.io/github/issues-closed-raw/opendatalab/MinerU)](https://github.com/opendatalab/MinerU/issues)
-[![PyPI version](https://badge.fury.io/py/magic-pdf.svg)](https://badge.fury.io/py/magic-pdf)
-[![Downloads](https://static.pepy.tech/badge/magic-pdf)](https://pepy.tech/project/magic-pdf)
-[![Downloads](https://static.pepy.tech/badge/magic-pdf/month)](https://pepy.tech/project/magic-pdf)
-
-<a href="https://trendshift.io/repositories/11174" target="_blank"><img src="https://trendshift.io/api/badge/repositories/11174" alt="opendatalab%2FMinerU | Trendshift" style="width: 200px; height: 55px;"/></a>
-
-
-
-
-
-[English](README.md) | [简体中文](README_zh-CN.md) | [日本語](README_ja-JP.md)
-
-</div>
-
-<div align="center">
-<p align="center">
-<a href="https://github.com/opendatalab/MinerU">MinerU: PDF-Extract-Kitに基づくエンドツーエンドのPDF解析ツールで、PDFからMarkdownへの変換をサポートします。</a>🚀🚀🚀<br>
-<a href="https://github.com/opendatalab/PDF-Extract-Kit">PDF-Extract-Kit: 高品質なPDFコンテンツ抽出のための包括的なツールキット</a>🔥🔥🔥
-</p>
-
-<p align="center">
-    👋 <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>
-
-# MinerU 
-
-
-## 紹介
-
-MinerUは、ワンストップのオープンソースで高品質なデータ抽出ツールであり、以下の主要な機能を含みます:
-
-- [Magic-PDF](#Magic-PDF)  PDFドキュメント抽出  
-- [Magic-Doc](#Magic-Doc)  ウェブページと電子書籍の抽出
-
-
-# Magic-PDF
-
-
-## 紹介
-
-Magic-PDFは、PDFドキュメントをMarkdown形式に変換するためのツールであり、ローカルに保存されたファイルやS3プロトコルをサポートするオブジェクトストレージ上のファイルを処理することができます。
-
-主な機能は以下の通りです:
-
-- 複数のフロントエンドモデル入力をサポート
-- ヘッダー、フッター、脚注、ページ番号の削除
-- 人間が読みやすいレイアウトフォーマット
-- 見出し、段落、リストなど、元のドキュメントの構造とフォーマットを保持
-- 画像や表を抽出してmarkdown内に表示
-- 数式をLaTeX形式に変換
-- 文字化けしたPDFの自動検出と変換
-- CPUおよびGPU環境に対応
-- Windows、Linux、macOSプラットフォームに対応
-
-
-https://github.com/user-attachments/assets/4bea02c9-6d54-4cd6-97ed-dff14340982c
-
-
-
-## プロジェクト全景
-
-![プロジェクト全景](docs/images/project_panorama_en.png)
-
-
-## フローチャート
-
-![フローチャート](docs/images/flowchart_en.png)
-
-### 依存リポジトリ
-
-- [PDF-Extract-Kit : 高品質なPDFコンテンツ抽出のための包括的なツールキット](https://github.com/opendatalab/PDF-Extract-Kit) 🚀🚀🚀
-
-## 入門ガイド
-
-### 要件
-
-- Python >= 3.9
-
-依存関係の競合を避けるために、仮想環境の使用をお勧めします。venvとcondaの両方が適しています。 
-例:
-```bash
-conda create -n MinerU python=3.10
-conda activate MinerU
-```
-
-### インストールと設定
-
-#### 1. Magic-PDFのインストール
-
-**1.依存パッケージのインストール**
-
-フル機能パッケージはdetectron2に依存しており、コンパイルインストールが必要です。   
-自分でコンパイルする必要がある場合は、https://github.com/facebookresearch/detectron2/issues/5114 を参照してください。  
-または、私たちの事前コンパイルされたwhlパッケージを直接使用できます(Python 3.10に限定):
-
-```bash
-pip install detectron2 --extra-index-url https://wheels.myhloli.com
-```
-
-**2.pipを使用してフル機能パッケージをインストールします**
->注意:pipでインストールされたパッケージはCPUのみをサポートし、クイックテストに最適です。
->
->CUDA/MPSによる加速については、[CUDAまたはMPSによる加速](#4-CUDAまたはMPSによる加速)を参照してください。
-
-```bash
-pip install -U magic-pdf[full]
-```
-
-> ❗️❗️❗️
-> 私たちは0.6.2 ベータ版を事前にリリースし、私たちのログに記載されている多くの問題に対処しました。しかし、このビルドはまだ完全なQAテストを経ておらず、最終的なリリース品質を表していません。問題に遭遇した場合は、問題を通じて速やかに報告するか、0.6.1バージョンに戻ることをお願いします。
-> ```bash
-> pip install -U magic-pdf[full]
-> ```
-
-
-#### 2. モデルの重みファイルのダウンロード
-
-詳細については、[how_to_download_models](docs/how_to_download_models_en.md)を参照してください。
-
-モデルの重みをダウンロードした後、'models'ディレクトリを大きなディスクスペースのあるディレクトリに移動します。できればSSDに移動してください。
-
-
-#### 3. 設定ファイルのコピーと設定
-リポジトリのルートディレクトリに[magic-pdf.template.json](magic-pdf.template.json)ファイルがあります。
-```bash
-cp magic-pdf.template.json ~/magic-pdf.json
-```
-magic-pdf.jsonで、"models-dir"をモデルの重みファイルがあるディレクトリに設定します。
-
-```json
-{
-  "models-dir": "/tmp/models"
-}
-```
-
-
-#### 4. CUDAまたはMPSによる加速
-利用可能なNvidia GPUを持っている場合や、Apple Siliconを搭載したMacを使用している場合は、それぞれCUDAまたはMPSによる加速を利用できます。
-##### CUDA
-
-CUDAバージョンに応じたPyTorchバージョンをインストールする必要があります。  
-この例では、CUDA 11.8バージョンをインストールします。詳細は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
-```
-また、設定ファイルmagic-pdf.jsonの"device-mode"の値を変更する必要があります。  
-```json
-{
-  "device-mode":"cuda"
-}
-```
-
-##### MPS
-
-Mシリーズチップデバイスを搭載したmacOSユーザーは、推論加速のためにMPSを使用できます。  
-設定ファイルmagic-pdf.jsonの"device-mode"の値を変更する必要があります。  
-```json
-{
-  "device-mode":"mps"
-}
-```
-
-
-### 使用方法
-
-#### 1. コマンドラインでの使用
-
-###### シンプル
-
-```bash
-magic-pdf pdf-command --pdf "pdf_path" --inside_model true
-```
-プログラムが終了した後、"/tmp/magic-pdf"ディレクトリに生成されたmarkdownファイルが見つかります。  
-markdownディレクトリには対応するxxx_model.jsonファイルがあります。   
-ポストプロセッシングパイプラインの二次開発を行う場合は、次のコマンドを使用できます:  
-```bash
-magic-pdf pdf-command --pdf "pdf_path" --model "model_json_path"
-```
-この方法では、モデルデータを再実行する必要がなくなり、デバッグが便利になります。
-
-
-###### 詳細
-
-```bash
-magic-pdf --help
-```
-
-
-#### 2. APIを使用した利用
-
-###### ローカル
-```python
-image_writer = DiskReaderWriter(local_image_dir)
-image_dir = str(os.path.basename(local_image_dir))
-jso_useful_key = {"_pdf_type": "", "model_list": []}
-pipe = UNIPipe(pdf_bytes, jso_useful_key, image_writer)
-pipe.pipe_classify()
-pipe.pipe_parse()
-md_content = pipe.pipe_mk_markdown(image_dir, drop_mode="none")
-```
-
-###### オブジェクトストレージ
-```python
-s3pdf_cli = S3ReaderWriter(pdf_ak, pdf_sk, pdf_endpoint)
-image_dir = "s3://img_bucket/"
-s3image_cli = S3ReaderWriter(img_ak, img_sk, img_endpoint, parent_path=image_dir)
-pdf_bytes = s3pdf_cli.read(s3_pdf_path, mode=s3pdf_cli.MODE_BIN)
-jso_useful_key = {"_pdf_type": "", "model_list": []}
-pipe = UNIPipe(pdf_bytes, jso_useful_key, s3image_cli)
-pipe.pipe_classify()
-pipe.pipe_parse()
-md_content = pipe.pipe_mk_markdown(image_dir, drop_mode="none")
-```
-
-デモは[demo.py](demo/demo.py)を参照してください
-
-
-# Magic-Doc
-
-
-## 紹介
-
-Magic-Docは、ウェブページや多形式の電子書籍をmarkdown形式に変換するためのツールです。
-
-主な機能は以下の通りです:
-
-- ウェブページ抽出
-  - テキスト、画像、表、数式情報のクロスモーダルな正確な解析。
-
-- 電子書籍ドキュメント抽出
-  - epub、mobiなどのさまざまなドキュメント形式をサポートし、テキストと画像に完全対応。
-
-- 言語タイプの識別
-  - 176の言語を正確に認識。
-
-https://github.com/opendatalab/MinerU/assets/11393164/a5a650e9-f4c0-463e-acc3-960967f1a1ca
-
-
-
-https://github.com/opendatalab/MinerU/assets/11393164/0f4a6fe9-6cca-4113-9fdc-a537749d764d
-
-
-
-https://github.com/opendatalab/MinerU/assets/11393164/20438a02-ce6c-4af8-9dde-d722a4e825b2
-
-
-
-
-## プロジェクトリポジトリ
-
-- [Magic-Doc](https://github.com/InternLM/magic-doc)
-  優れたウェブページと電子書籍の抽出ツール
-
-
-# 貢献者の皆様に感謝
-
-<a href="https://github.com/opendatalab/MinerU/graphs/contributors">
-  <img src="https://contrib.rocks/image?repo=opendatalab/MinerU" />
-</a>
-
-
-# ライセンス情報
-
-[LICENSE.md](LICENSE.md)
-
-このプロジェクトは現在、PyMuPDFを利用して高度な機能を提供していますが、AGPLライセンスに準拠しているため、特定の使用ケースに制限を課す可能性があります。今後のバージョンでは、より寛容なライセンスのPDF処理ライブラリへの移行を検討し、ユーザーフレンドリーさと柔軟性を向上させる予定です。
-
-
-# 謝辞
-
-- [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR)
-- [PyMuPDF](https://github.com/pymupdf/PyMuPDF)
-- [fast-langdetect](https://github.com/LlmKira/fast-langdetect)
-- [pdfminer.six](https://github.com/pdfminer/pdfminer.six)
-
-
-# 引用
-
-```bibtex
-@misc{wang2024mineruopensourcesolutionprecise,
-      title={MinerU: An Open-Source Solution for Precise Document Content Extraction}, 
-      author={Bin Wang and Chao Xu and Xiaomeng Zhao and Linke Ouyang and Fan Wu and Zhiyuan Zhao and Rui Xu and Kaiwen Liu and Yuan Qu and Fukai Shang and Bo Zhang and Liqun Wei and Zhihao Sui and Wei Li and Botian Shi and Yu Qiao and Dahua Lin and Conghui He},
-      year={2024},
-      eprint={2409.18839},
-      archivePrefix={arXiv},
-      primaryClass={cs.CV},
-      url={https://arxiv.org/abs/2409.18839}, 
-}
-
-@article{he2024opendatalab,
-  title={Opendatalab: Empowering general artificial intelligence with open datasets},
-  author={He, Conghui and Li, Wei and Jin, Zhenjiang and Xu, Chao and Wang, Bin and Lin, Dahua},
-  journal={arXiv preprint arXiv:2407.13773},
-  year={2024}
-}
-```
-
-# スター履歴
-
-<a>
- <picture>
-   <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=opendatalab/MinerU&type=Date&theme=dark" />
-   <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=opendatalab/MinerU&type=Date" />
-   <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=opendatalab/MinerU&type=Date" />
- </picture>
-</a>
-
-# リンク
-- [LabelU (軽量なマルチモーダルデータアノテーションツール)](https://github.com/opendatalab/labelU)
-- [LabelLLM (オープンソースのLLM対話アノテーションプラットフォーム)](https://github.com/opendatalab/LabelLLM)
-- [PDF-Extract-Kit (高品質なPDFコンテンツ抽出のための包括的なツールキット)](https://github.com/opendatalab/PDF-Extract-Kit)

+ 18 - 5
README_zh-CN.md

@@ -81,6 +81,7 @@
             <li><a href="#在线体验">在线体验</a></li>
             <li><a href="#使用CPU快速体验">使用CPU快速体验</a></li>
             <li><a href="#使用GPU">使用GPU</a></li>
+            <li><a href="#使用NPU">使用NPU</a></li>
             </ul>
         </li>
         <li><a href="#使用">使用方式</a>
@@ -129,7 +130,7 @@ https://github.com/user-attachments/assets/4bea02c9-6d54-4cd6-97ed-dff14340982c
 - OCR支持84种语言的检测与识别
 - 支持多种输出格式,如多模态与NLP的Markdown、按阅读顺序排序的JSON、含有丰富信息的中间格式等
 - 支持多种可视化结果,包括layout可视化、span可视化等,便于高效确认输出效果与质检
-- 支持CPU和GPU环境
+- 支持纯CPU环境运行,并支持GPU/NPU加速
 - 兼容Windows、Linux和Mac平台
 
 ## 快速开始
@@ -141,6 +142,7 @@ https://github.com/user-attachments/assets/4bea02c9-6d54-4cd6-97ed-dff14340982c
 - [在线体验(无需任何安装)](#在线体验)
 - [使用CPU快速体验(Windows,Linux,Mac)](#使用cpu快速体验)
 - [Linux/Windows + CUDA](#使用gpu)
+- [Linux + CANN](#使用NPU)
 
 
 > [!WARNING]
@@ -157,13 +159,13 @@ https://github.com/user-attachments/assets/4bea02c9-6d54-4cd6-97ed-dff14340982c
         <td colspan="3" rowspan="2">操作系统</td>
     </tr>
     <tr>
-        <td>Ubuntu 22.04 LTS</td>
+        <td>Linux after 2019</td>
         <td>Windows 10 / 11</td>
         <td>macOS 11+</td>
     </tr>
     <tr>
         <td colspan="3">CPU</td>
-        <td>x86_64(暂不支持ARM Linux)</td>
+        <td>x86_64 / arm64</td>
         <td>x86_64(暂不支持ARM Windows)</td>
         <td>x86_64 / arm64</td>
     </tr>
@@ -172,6 +174,10 @@ https://github.com/user-attachments/assets/4bea02c9-6d54-4cd6-97ed-dff14340982c
         <td colspan="3">大于等于16GB,推荐32G以上</td>
     </tr>
     <tr>
+        <td colspan="3">存储空间</td>
+        <td colspan="3">大于等于20GB,推荐使用SSD以获得最佳性能</td>
+    </tr>
+    <tr>
         <td colspan="3">python版本</td>
         <td colspan="3">3.10 (请务必通过conda创建3.10虚拟环境)</td>
     </tr>
@@ -188,6 +194,12 @@ https://github.com/user-attachments/assets/4bea02c9-6d54-4cd6-97ed-dff14340982c
         <td>None</td>
     </tr>
     <tr>
+        <td colspan="3">CANN环境(NPU支持)</td>
+        <td>8.0+(Ascend 910b)</td>
+        <td>None</td>
+        <td>None</td>
+    </tr>
+    <tr>
         <td rowspan="2">GPU硬件支持列表</td>
         <td colspan="2">显存8G以上</td>
         <td colspan="2">
@@ -195,7 +207,6 @@ https://github.com/user-attachments/assets/4bea02c9-6d54-4cd6-97ed-dff14340982c
         8G显存及以上可开启全部加速功能</td>
         <td rowspan="2">None</td>
     </tr>
-
 </table>
 
 ### 在线体验
@@ -278,7 +289,9 @@ pip install -U magic-pdf[full] --extra-index-url https://wheels.myhloli.com -i h
   docker run --rm -it --gpus=all mineru:latest /bin/bash
   magic-pdf --help
   ```
-    
+### 使用NPU
+
+如果您的设备存在NPU加速硬件,则可以通过以下教程使用NPU加速:
 
 ## 使用