提交 8357cd40 编写于 作者: D dongdaxiang

fix input of unet

上级 6b75a5c6
......@@ -27,14 +27,14 @@ namespace sdk_cpp {
if (conf.has_##name()) { \
item.set(conf.name()); \
} else { \
LOG(ERROR) << "Not found key in configue: " << #name; \
VLOG(2) << "Not found key in configue: " << #name; \
} \
} while (0)
#define ASSIGN_CONF_ITEM(dest, src, fail) \
do { \
if (!src.init) { \
LOG(ERROR) << "Cannot assign an unintialized item: " << #src \
VLOG(2) << "Cannot assign an unintialized item: " << #src \
<< " to dest: " << #dest; \
return fail; \
} \
......
......@@ -18,7 +18,7 @@ import sys
import cv2
client = Client()
client.load_client_config(sys.argv[1])
client.load_client_config("unet_client/serving_client_conf.prototxt")
client.connect(["127.0.0.1:9494"])
preprocess = Sequential(
......@@ -27,9 +27,7 @@ preprocess = Sequential(
postprocess = SegPostprocess(2)
for i in range(100):
filename = sys.argv[2]
im = preprocess(filename)
fetch_map = client.predict(feed={"image": im}, fetch=["output"])
fetch_map["filename"] = filename
postprocess(fetch_map)
im = preprocess("N0060.jpg")
fetch_map = client.predict(feed={"image": im}, fetch=["output"])
fetch_map["filename"] = filename
postprocess(fetch_map)
......@@ -27,7 +27,7 @@ class ServingModels(object):
self.model_dict["ObjectDetection"] = ["faster_rcnn", "yolov3"]
self.model_dict["ImageSegmentation"] = ["unet", "deeplabv3"]
self.model_dict["ImageClassification"] = [
"resnet_v2_50_imagenet", "efficientnetb6_imagenet"
"resnet_v2_50_imagenet", "mobilenet_v2_imagenet"
]
image_class_url = "https://paddle-serving.bj.bcebos.com/paddle_hub_models/image/ImageClassification/"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册