"official/legacy/detection/modeling/architecture/spinenet.py" did not exist on "2a595d51dd5c1f7a84dc47939fbb61b0f6e991b2"
how_to_download_models_zh_cn.md 1.95 KB
Newer Older
1
### 安装 Git LFS
2
开始之前,请确保您的系统上已安装 Git 大文件存储 (Git LFS)。使用以下命令进行安装
3
4
5
6
7

```bash
git lfs install
```

8
### 从 Hugging Face 下载模型
9
请使用以下命令从 Hugging Face 下载 PDF-Extract-Kit 模型:
10
11
12
13
14

```bash
git lfs clone https://huggingface.co/wanderkid/PDF-Extract-Kit
```

15
确保在克隆过程中启用了 Git LFS,以便正确下载所有大文件。
16
17


18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
### 从 ModelScope 下载模型

#### SDK下载

```bash
# 首先安装modelscope
pip install modelscope
```

```python
# 使用modelscope sdk下载模型
from modelscope import snapshot_download
model_dir = snapshot_download('wanderkid/PDF-Extract-Kit')
```

#### Git下载
也可以使用git clone从 ModelScope 下载模型:

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
需要先安装git lfs

>##### On Linux
>
>Debian and RPM packages are available from packagecloud, see the [Linux installation instructions](INSTALLING.md).
>
>##### On macOS
>
>[Homebrew](https://brew.sh) bottles are distributed and can be installed via `brew install git-lfs`.
>
>##### On Windows
>
>Git LFS is included in the distribution of [Git for Windows](https://gitforwindows.org/).
>Alternatively, you can install a recent version of Git LFS from the [Chocolatey](https://chocolatey.org/) package manager.

然后通过git clone下载模型:
52
```bash
53
git lfs clone https://www.modelscope.cn/wanderkid/PDF-Extract-Kit.git
54
55
56
```


57
将 'models' 目录移动到具有较大磁盘空间的目录中,最好是在固态硬盘(SSD)上。
58

59
60

模型文件夹的结构如下,包含了不同组件的配置文件和权重文件:
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
```
./
├── Layout
│   ├── config.json
│   └── model_final.pth
├── MFD
│   └── weights.pt
├── MFR
│   └── UniMERNet
│       ├── config.json
│       ├── preprocessor_config.json
│       ├── pytorch_model.bin
│       ├── README.md
│       ├── tokenizer_config.json
│       └── tokenizer.json
└── README.md
77
```