Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
cnn authored Jul 30, 2021
1 parent e23725c commit efaf551
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions deploy/serving/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ python tools/infer.py -c configs/yolov3/yolov3_darknet53_270e_coco.yml --infer_i
```

## 2. 安装 paddle serving
请参考[PaddleServing](https://github.com/PaddlePaddle/Serving/tree/v0.5.0) 中安装教程安装
请参考[PaddleServing](https://github.com/PaddlePaddle/Serving/tree/v0.6.0) 中安装教程安装(版本>=0.6.0)。

## 3. 导出模型
PaddleDetection在训练过程包括网络的前向和优化器相关参数,而在部署过程中,我们只需要前向参数,具体参考:[导出模型](https://github.com/PaddlePaddle/PaddleDetection/blob/develop/deploy/EXPORT_MODEL.md)
Expand Down Expand Up @@ -87,7 +87,7 @@ fetch_var {
cd output_inference/yolov3_darknet53_270e_coco/
# GPU
python -m paddle_serving_server_gpu.serve --model serving_server --port 9393 --gpu_ids 0
python -m paddle_serving_server.serve --model serving_server --port 9393 --gpu_ids 0
# CPU
python -m paddle_serving_server.serve --model serving_server --port 9393
Expand Down
8 changes: 6 additions & 2 deletions deploy/serving/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@
fetch_map = client.predict(
feed={
"image": im,
"im_size": np.array(list(im.shape[1:])),
"im_shape": np.array(list(im.shape[1:])).reshape(-1),
"scale_factor": np.array([1.0, 1.0]).reshape(-1),
},
fetch=["multiclass_nms_0.tmp_0"])
fetch=["save_infer_model/scale_0.tmp_1"],
batch=False)
print(fetch_map)
fetch_map["image"] = sys.argv[1]
postprocess(fetch_map)

0 comments on commit efaf551

Please sign in to comment.