From a1380153172bb5bc795435a622367d6cfef6a13c Mon Sep 17 00:00:00 2001 From: MRXLT Date: Mon, 25 May 2020 14:50:11 +0800 Subject: [PATCH] fix faster rcnn demo --- .../{new_test_client.py => test_client.py} | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) rename python/examples/faster_rcnn_model/{new_test_client.py => test_client.py} (86%) diff --git a/python/examples/faster_rcnn_model/new_test_client.py b/python/examples/faster_rcnn_model/test_client.py similarity index 86% rename from python/examples/faster_rcnn_model/new_test_client.py rename to python/examples/faster_rcnn_model/test_client.py index 0c6c615f..ce577a3c 100755 --- a/python/examples/faster_rcnn_model/new_test_client.py +++ b/python/examples/faster_rcnn_model/test_client.py @@ -14,6 +14,8 @@ from paddle_serving_client import Client from paddle_serving_app.reader import * +import sys +import numpy as np preprocess = Sequential([ File2Image(), BGR2RGB(), Div(255.0), @@ -24,11 +26,10 @@ preprocess = Sequential([ postprocess = RCNNPostprocess("label_list.txt", "output") client = Client() -client.load_client_config( - "faster_rcnn_client_conf/serving_client_conf.prototxt") -client.connect(['127.0.0.1:9393']) +client.load_client_config(sys.argv[1]) +client.connect(['127.0.0.1:9494']) -im = preprocess(sys.argv[2]) +im = preprocess(sys.argv[3]) fetch_map = client.predict( feed={ "image": im, @@ -36,5 +37,5 @@ fetch_map = client.predict( "im_shape": np.array(list(im.shape[1:]) + [1.0]) }, fetch=["multiclass_nms"]) -fetch_map["image"] = sys.argv[1] +fetch_map["image"] = sys.argv[3] postprocess(fetch_map) -- GitLab