README.md 1.26 KB
Newer Older
shniubobo's avatar
shniubobo committed
1
# 基于MinerU的PDF解析API
2

shniubobo's avatar
shniubobo committed
3
4
- MinerU的GPU镜像构建
- 基于FastAPI的PDF解析接口
5

shniubobo's avatar
shniubobo committed
6
## 构建方式
7

shniubobo's avatar
shniubobo committed
8
9
10
```
docker build -t mineru-api .
```
11

shniubobo's avatar
shniubobo committed
12
或者使用代理:
13

shniubobo's avatar
shniubobo committed
14
15
16
```
docker build --build-arg http_proxy=http://127.0.0.1:7890 --build-arg https_proxy=http://127.0.0.1:7890 -t mineru-api .
```
17

shniubobo's avatar
shniubobo committed
18
## 启动命令
19

shniubobo's avatar
shniubobo committed
20
21
22
```
docker run --rm -it --gpus=all -v ./paddleocr:/root/.paddleocr -p 8000:8000 mineru-api
```
23

shniubobo's avatar
shniubobo committed
24
初次调用 API 时会自动下载 paddleocr 的模型(约数十 MB),其余模型已包含在镜像中。
25

shniubobo's avatar
shniubobo committed
26
## 测试参数
27

shniubobo's avatar
shniubobo committed
28
访问地址:
29

shniubobo's avatar
shniubobo committed
30
31
32
33
```
http://localhost:8000/docs
http://127.0.0.1:8000/docs
```
34

shniubobo's avatar
shniubobo committed
35
## 旧版镜像地址
36

shniubobo's avatar
shniubobo committed
37
38
39
> 阿里云地址:docker pull registry.cn-beijing.aliyuncs.com/quincyqiang/mineru:0.1-models
>
> dockerhub地址:docker pull quincyqiang/mineru:0.1-models
40
41


shniubobo's avatar
shniubobo committed
42
## 旧版截图
43

shniubobo's avatar
shniubobo committed
44
### 启动命令
45

shniubobo's avatar
shniubobo committed
46
![](https://i-blog.csdnimg.cn/direct/bcff4f524ea5400db14421ba7cec4989.png)
47

shniubobo's avatar
shniubobo committed
48
具体截图请见博客:https://blog.csdn.net/yanqianglifei/article/details/141979684
49

shniubobo's avatar
shniubobo committed
50
### 启动日志
51

shniubobo's avatar
shniubobo committed
52
![](https://i-blog.csdnimg.cn/direct/4eb5657567e4415eba912179dca5c8aa.png)
53

shniubobo's avatar
shniubobo committed
54
### 测试参数
55

shniubobo's avatar
shniubobo committed
56
![](https://i-blog.csdnimg.cn/direct/8b3a2bc5908042268e8cc69756e331a2.png)
57

shniubobo's avatar
shniubobo committed
58
### 解析效果
59

shniubobo's avatar
shniubobo committed
60
![](https://i-blog.csdnimg.cn/direct/a54dcae834ae48d498fb595aca4212c3.png)