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

fix input of unet

上级 6b75a5c6
...@@ -27,14 +27,14 @@ namespace sdk_cpp { ...@@ -27,14 +27,14 @@ namespace sdk_cpp {
if (conf.has_##name()) { \ if (conf.has_##name()) { \
item.set(conf.name()); \ item.set(conf.name()); \
} else { \ } else { \
LOG(ERROR) << "Not found key in configue: " << #name; \ VLOG(2) << "Not found key in configue: " << #name; \
} \ } \
} while (0) } while (0)
#define ASSIGN_CONF_ITEM(dest, src, fail) \ #define ASSIGN_CONF_ITEM(dest, src, fail) \
do { \ do { \
if (!src.init) { \ if (!src.init) { \
LOG(ERROR) << "Cannot assign an unintialized item: " << #src \ VLOG(2) << "Cannot assign an unintialized item: " << #src \
<< " to dest: " << #dest; \ << " to dest: " << #dest; \
return fail; \ return fail; \
} \ } \
......
...@@ -18,7 +18,7 @@ import sys ...@@ -18,7 +18,7 @@ import sys
import cv2 import cv2
client = Client() 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"]) client.connect(["127.0.0.1:9494"])
preprocess = Sequential( preprocess = Sequential(
...@@ -27,9 +27,7 @@ preprocess = Sequential( ...@@ -27,9 +27,7 @@ preprocess = Sequential(
postprocess = SegPostprocess(2) postprocess = SegPostprocess(2)
for i in range(100): im = preprocess("N0060.jpg")
filename = sys.argv[2] fetch_map = client.predict(feed={"image": im}, fetch=["output"])
im = preprocess(filename) fetch_map["filename"] = filename
fetch_map = client.predict(feed={"image": im}, fetch=["output"]) postprocess(fetch_map)
fetch_map["filename"] = filename
postprocess(fetch_map)
...@@ -27,7 +27,7 @@ class ServingModels(object): ...@@ -27,7 +27,7 @@ class ServingModels(object):
self.model_dict["ObjectDetection"] = ["faster_rcnn", "yolov3"] self.model_dict["ObjectDetection"] = ["faster_rcnn", "yolov3"]
self.model_dict["ImageSegmentation"] = ["unet", "deeplabv3"] self.model_dict["ImageSegmentation"] = ["unet", "deeplabv3"]
self.model_dict["ImageClassification"] = [ 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/" 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.
先完成此消息的编辑!
想要评论请 注册