README.md 2.1 KB
Newer Older
M
MRXLT 已提交
1 2
# OCR 

W
wangjiawei04 已提交
3 4
(English|[简体中文](./README_CN.md))

M
MRXLT 已提交
5 6 7 8
## Get Model
```
python -m paddle_serving_app.package --get_model ocr_rec
tar -xzvf ocr_rec.tar.gz
W
wangjiawei04 已提交
9 10
python -m paddle_serving_app.package --get_model ocr_det
tar -xzvf ocr_det.tar.gz
M
MRXLT 已提交
11
```
W
wangjiawei04 已提交
12 13 14 15 16 17 18

## Get Dataset
```
wget --no-check-certificate https://paddle-serving.bj.bcebos.com/ocr/test_imgs.tar
tar xf test_imgs.tar
```

W
wangjiawei04 已提交
19 20 21 22 23 24 25 26 27 28 29
## Web Service

### Start Service

```
python -m paddle_serving_server_gpu.serve --model ocr_det_model --port 9293 --gpu_id 0
python ocr_web_server.py
```

### Client Prediction
```
W
wangjiawei04 已提交
30 31
python ocr_web_client.py
```
W
wangjiawei04 已提交
32
If you want a faster web service, please try Web Debugger Service
W
wangjiawei04 已提交
33 34 35 36 37 38 39 40 41

## Web Debugger Service
```
python ocr_debugger_server.py
```

## Web Debugger Client Prediction
```
python ocr_web_clint.py
M
MRXLT 已提交
42
```
W
wangjiawei04 已提交
43 44 45 46

## Benchmark

CPU: Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz * 40
W
wangjiawei04 已提交
47

W
wangjiawei04 已提交
48 49
GPU: Nvidia Tesla V100 * 1

W
wangjiawei04 已提交
50 51
Dataset: RCTW 500 sample images

W
wangjiawei04 已提交
52 53 54 55
| engine                       | client read image(ms) | client-server tras time(ms) | server read image(ms) | det pre(ms) | det infer(ms) | det post(ms) | rec pre(ms) | rec infer(ms) | rec post(ms) | server-client trans time(ms) | server side time consumption(ms) | server side overhead(ms) | total time(ms) |
|------------------------------|----------------|----------------------------|------------------|--------------------|------------------|--------------------|--------------------|------------------|--------------------|--------------------------|--------------------|--------------|---------------|
| Serving web service          | 112.02         | 13.41                      | 109.97           | 2.82               | 87.76            | 4.29               | 3.98               | 78.51            | 3.66               | 4.12                     | 181.02             | 239.52       | 420.54        |
| Serving Debugger web service | 111.68         | 16.42                      | 115.27           | 2.93               | 20.63            | 3.97               | 4.48               | 13.84            | 3.60               | 6.91                     | 49.45              | 250.28       | 299.73        |