README.md 865 字节
Newer Older
T
Thomas Young 已提交
1 2
# C++ PP-Shitu Service

T
Thomas Young 已提交
3
**注意:** Since opencv library is used in the pre-processing and post-processing of C++ code, you need to open `WITH_OPENCV` option to compile the C++ server, see [COMPILE.md](../../../../doc/Compile_CN.md)
T
Thomas Young 已提交
4

Z
ZhangYulongg 已提交
5 6 7 8
```
# Dependent packages need to be installed
pip install faiss-cpu==1.7.1.post2 -i https://mirror.baidu.com/pypi/simple
```
S
stephon 已提交
9 10 11 12

## Get Model
```
wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/serving/pp_shitu.tar.gz
Z
ZhangYulongg 已提交
13
tar -xvf pp_shitu.tar.gz
S
stephon 已提交
14 15 16
```

## Get test images and index
B
Bin Lu 已提交
17
```
S
stephon 已提交
18 19
wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/data/drink_dataset_v1.0.tar
tar -xvf drink_dataset_v1.0.tar
B
Bin Lu 已提交
20
```
S
stephon 已提交
21 22 23 24 25 26 27 28 29

## RPC Service
### Start Service
```
sh run_cpp_serving.sh
```

### Client Prediction
```
Z
ZhangYulongg 已提交
30
python3 test_cpp_serving_pipeline.py ./drink_dataset_v1.0/test_images/nongfu_spring.jpeg
B
Bin Lu 已提交
31
```