提交 143b7e7b 编写于 作者: D Dong Daxiang 提交者: GitHub

Update new_test_client.py

上级 64e24e86
...@@ -13,10 +13,7 @@ ...@@ -13,10 +13,7 @@
# limitations under the License. # limitations under the License.
from paddle_serving_client import Client from paddle_serving_client import Client
import sys from paddle_serving_app.reader import *
from paddle_serving_app.reader.pddet import Detection
from paddle_serving_app.reader import File2Image, Sequential, Normalize, Resize, Transpose, Div, BGR2RGB, RCNNPostprocess
import numpy as np
preprocess = Sequential([ preprocess = Sequential([
File2Image(), BGR2RGB(), Div(255.0), File2Image(), BGR2RGB(), Div(255.0),
...@@ -30,14 +27,8 @@ client = Client() ...@@ -30,14 +27,8 @@ client = Client()
client.load_client_config(sys.argv[1]) client.load_client_config(sys.argv[1])
client.connect(['127.0.0.1:9393']) client.connect(['127.0.0.1:9393'])
for i in range(100): im = preprocess(sys.argv[2])
im = preprocess(sys.argv[2]) fetch_map = client.predict(feed={"image": im, "im_info": np.array(list(im.shape[1:]) + [1.0]),
fetch_map = client.predict( "im_shape": np.array(list(im.shape[1:]) + [1.0])}, fetch=["multiclass_nms"])
feed={ fetch_map["image"] = sys.argv[2]
"image": im, postprocess(fetch_map)
"im_info": np.array(list(im.shape[1:]) + [1.0]),
"im_shape": np.array(list(im.shape[1:]) + [1.0])
},
fetch=["multiclass_nms"])
fetch_map["image"] = sys.argv[2]
postprocess(fetch_map)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册