README.md 1.1 KB
Newer Older
B
barriery 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# OCR 

(English|[简体中文](./README_CN.md))

## Get Model
```
python -m paddle_serving_app.package --get_model ocr_rec
tar -xzvf ocr_rec.tar.gz
python -m paddle_serving_app.package --get_model ocr_det
tar -xzvf ocr_det.tar.gz
```

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

## Start Service

B
barriery 已提交
21 22 23
You can choose one of the following versions to launch start Service.

### Remote Service Version
B
barriery 已提交
24
```
B
barriery 已提交
25 26
python -m paddle_serving_server_gpu.serve --model ocr_det_model --port 12000 --gpu_id 0 &> det.log &
python -m paddle_serving_server_gpu.serve --model ocr_rec_model --port 12001 --gpu_id 0 &> rec.log &
B
barriery 已提交
27 28 29
python pipeline_server.py &>pipeline.log &
```

B
barriery 已提交
30 31 32 33 34 35 36 37 38 39 40
### Local Service Version
```
python local_service_pipeline_server.py &>pipeline.log &
```

### Hybrid Service Version
```
python -m paddle_serving_server_gpu.serve --model ocr_rec_model --port 12001 --gpu_id 0 &> rec.log &
python hybrid_service_pipeline_server.py &>pipeline.log &
```

B
barriery 已提交
41
## Client Prediction
B
barriery 已提交
42 43 44 45 46 47 48

### RPC
```
python pipeline_rpc_client.py
```

### HTTP
B
barriery 已提交
49
```
B
barriery 已提交
50
python pipeline_http_client.py
B
barriery 已提交
51
```