README.md 1.0 KB
Newer Older
M
MRXLT 已提交
1 2 3 4 5 6
# OCR 

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

## RPC Service

### Start Service

W
wangjiawei04 已提交
15 16 17 18 19 20 21
For the following two code block, please check your devices and pick one  
for GPU device
```
python -m paddle_serving_server_gpu.serve --model ocr_rec_model --port 9292 --gpu_id 0
python -m paddle_serving_server_gpu.serve --model ocr_det_model --port 9293 --gpu_id 0
```
for CPU device
M
MRXLT 已提交
22 23
```
python -m paddle_serving_server.serve --model ocr_rec_model --port 9292
W
wangjiawei04 已提交
24
python -m paddle_serving_server.serve --model ocr_det_model --port 9293
M
MRXLT 已提交
25 26 27 28 29
```

### Client Prediction

```
W
wangjiawei04 已提交
30 31 32 33 34 35 36 37 38 39 40 41 42 43
python ocr_rpc_client.py
```

## 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 已提交
44 45 46 47 48 49 50 51 52 53 54
python ocr_web_client.py
```

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

## Web Debugger Client Prediction
```
python ocr_web_clint.py
M
MRXLT 已提交
55
```