Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pdf-miner
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Qin Kaijie
pdf-miner
Commits
2a06e0c8
Commit
2a06e0c8
authored
Aug 02, 2024
by
xuchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the documentation on how to download the model more concise
parent
f052c75e
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
357 additions
and
41 deletions
+357
-41
README_zh-CN_v2.md
README_zh-CN_v2.md
+1
-2
how_to_download_models_zh_cn.md
docs/how_to_download_models_zh_cn.md
+20
-39
magicpdf.py
magic_pdf/cli/magicpdf.py
+336
-0
No files found.
README_zh-CN_v2.md
View file @
2a06e0c8
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<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>
<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 -->
<!-- language -->
[
English
](
README.md
)
|
[
简体中文
](
README_zh-CN.md
)
|
[
日本語
](
README_ja-JP.md
)
[
English
](
README.md
)
|
[
简体中文
](
README_zh-CN.md
)
<!-- hot link -->
<!-- hot link -->
...
@@ -305,7 +305,6 @@ TODO
...
@@ -305,7 +305,6 @@ TODO
-
漫画书、艺术图册、小学教材、习题尚不能很好解析
-
漫画书、艺术图册、小学教材、习题尚不能很好解析
-
在一些公式密集的PDF上强制启用OCR效果会更好
-
在一些公式密集的PDF上强制启用OCR效果会更好
-
如果您要处理包含大量公式的pdf,强烈建议开启OCR功能。使用pymuPDF提取文字的时候会出现文本行互相重叠的情况导致公式插入位置不准确。
-
如果您要处理包含大量公式的pdf,强烈建议开启OCR功能。使用pymuPDF提取文字的时候会出现文本行互相重叠的情况导致公式插入位置不准确。
-
好消息是,这些我们正在努力实现!
好消息是,这些我们正在努力实现!
...
...
docs/how_to_download_models_zh_cn.md
View file @
2a06e0c8
...
@@ -2,38 +2,35 @@
...
@@ -2,38 +2,35 @@
模型文件可以从Hugging Face 或 Model Scope 下载,由于网络原因,国内用户访问HF 可能会失败,请使用 ModelScope。
模型文件可以从Hugging Face 或 Model Scope 下载,由于网络原因,国内用户访问HF 可能会失败,请使用 ModelScope。
[
Hugging Face
](
#从-Hugging-Face-下载模型
)
[
Hugging Face
](
#从-Hugging-Face-下载模型
)
[
ModelScope
](
#从-ModelScope-下载模型
)
[
ModelScope
](
#从-ModelScope-下载模型
)
## 从 Hugging Face 下载模型
## 方法一:从 Hugging Face 下载模型
### 1.安装 Git LFS
开始之前,请确保您的系统上已安装 Git 大文件存储 (Git LFS)。使用以下命令进行安装
```
bash
git lfs
install
```
### 2.从 Hugging Face 下载模型
使用Git LFS 从Hugging Face下载模型文件
请使用以下命令从 Hugging Face 下载 PDF-Extract-Kit 模型:
```
bash
```
bash
git lfs clone https://huggingface.co/wanderkid/PDF-Extract-Kit
git lfs
install
# 安装 Git 大文件存储插件 (Git LFS)
git lfs clone https://huggingface.co/wanderkid/PDF-Extract-Kit
# 从 Hugging Face 下载 PDF-Extract-Kit 模型
```
```
确保在克隆过程中启用了 Git LFS,以便正确下载所有大文件。
## 方法二:从 ModelScope 下载模型
ModelScope 支持SDK或模型下载,任选一个即可。
## 从 ModelScope 下载模型
[
Git lsf下载
](
#git下载
)
ModelScope 支持SDK或模型下载
[
SDK下载
](
#sdk下载
)
[
SDK下载
](
#sdk下载
)
[
Git下载
](
#git下载
)
### 1)利用Git lsf下载
```
bash
git lfs
install
git lfs clone https://www.modelscope.cn/wanderkid/PDF-Extract-Kit.git
```
### SDK下载
###
2)利用
SDK下载
```
bash
```
bash
# 首先安装modelscope
# 首先安装modelscope
...
@@ -46,35 +43,18 @@ from modelscope import snapshot_download
...
@@ -46,35 +43,18 @@ from modelscope import snapshot_download
model_dir
=
snapshot_download
(
'wanderkid/PDF-Extract-Kit'
)
model_dir
=
snapshot_download
(
'wanderkid/PDF-Extract-Kit'
)
```
```
### Git下载
也可以使用git clone从 ModelScope 下载模型:
#### 1.安装 Git LFS
开始之前,请确保您的系统上已安装 Git 大文件存储 (Git LFS)。使用以下命令进行安装
```
bash
git lfs
install
```
#### 2.然后通过git lfs下载模型
```
bash
git lfs clone https://www.modelscope.cn/wanderkid/PDF-Extract-Kit.git
```
## 额外步骤
## 额外步骤
### 1.检查模型目录是否下载完整
### 1.检查模型目录是否下载完整
模型文件夹的结构如下,包含了不同组件的配置文件和权重文件:
模型文件夹的结构如下,包含了不同组件的配置文件和权重文件:
```
```
./
./
├── Layout
├── Layout
# 布局检测模型
│ ├── config.json
│ ├── config.json
│ └── model_final.pth
│ └── model_final.pth
├── MFD
├── MFD
# 公式检测
│ └── weights.pt
│ └── weights.pt
├── MFR
├── MFR
# 公式识别模型
│ └── UniMERNet
│ └── UniMERNet
│ ├── config.json
│ ├── config.json
│ ├── preprocessor_config.json
│ ├── preprocessor_config.json
...
@@ -82,7 +62,7 @@ git lfs clone https://www.modelscope.cn/wanderkid/PDF-Extract-Kit.git
...
@@ -82,7 +62,7 @@ git lfs clone https://www.modelscope.cn/wanderkid/PDF-Extract-Kit.git
│ ├── README.md
│ ├── README.md
│ ├── tokenizer_config.json
│ ├── tokenizer_config.json
│ └── tokenizer.json
│ └── tokenizer.json
│── TabRec
│── TabRec
# 表格识别模型
│ └─StructEqTable
│ └─StructEqTable
│ ├── config.json
│ ├── config.json
│ ├── generation_config.json
│ ├── generation_config.json
...
@@ -100,3 +80,4 @@ git lfs clone https://www.modelscope.cn/wanderkid/PDF-Extract-Kit.git
...
@@ -100,3 +80,4 @@ git lfs clone https://www.modelscope.cn/wanderkid/PDF-Extract-Kit.git
### 3.移动模型到固态硬盘
### 3.移动模型到固态硬盘
将 'models' 目录移动到具有较大磁盘空间的目录中,最好是在固态硬盘(SSD)上。
将 'models' 目录移动到具有较大磁盘空间的目录中,最好是在固态硬盘(SSD)上。
此外在
`~/magic-pdf.json`
里修改模型的目录指向最终的模型存放位置,否则会报模型无法加载的错误。
magic_pdf/cli/magicpdf.py
0 → 100644
View file @
2a06e0c8
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment