README_CN.md 827 字节
Newer Older
T
Thomas Young 已提交
1 2
# C++ PP-Shitu Service服务

T
Thomas Young 已提交
3
**注意:** 由于C++代码中前后处理中使用了OPENCV库,您需要使用开启WITH_OPENCV选项编译的C++ Server,详见[COMPILE.md](../../../../doc/Compile_CN.md)
T
Thomas Young 已提交
4

Z
ZhangYulongg 已提交
5
```
T
Thomas Young 已提交
6
## 需安装相关依赖包
Z
ZhangYulongg 已提交
7 8
pip install faiss-cpu==1.7.1.post2 -i https://mirror.baidu.com/pypi/simple
```
S
stephon 已提交
9 10 11 12

## 获取模型
```
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
```

## 获取测试图像和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 服务
### 启动服务端
```
sh run_cpp_serving.sh
```

### 客户端预测
```
Z
ZhangYulongg 已提交
30
python3 test_cpp_serving_pipeline.py ./drink_dataset_v1.0/test_images/nongfu_spring.jpeg
S
stephon 已提交
31
```