diff --git a/python/examples/imagenet/resnet50_http_client.py b/python/examples/imagenet/resnet50_http_client.py index f2ba9622f5ee49f24a2423a72c3c713e7c763d0e..48efbb88c2c3525a0d38d238c6f093f518f5e0b8 100644 --- a/python/examples/imagenet/resnet50_http_client.py +++ b/python/examples/imagenet/resnet50_http_client.py @@ -62,10 +62,7 @@ for i in range(10): img = seq(image_file) fetch_map = client.predict( feed={"image": img}, fetch=["score"], batch=False) - prob = max(fetch_map["score"][0]) - label = label_dict[fetch_map["score"][0].tolist().index(prob)].strip( - ).replace(",", "") - print("prediction: {}, probability: {}".format(label, prob)) + print(fetch_map) end = time.time() print(end - start) diff --git a/python/examples/imdb/test_http_client.py b/python/examples/imdb/test_http_client.py index a8e12850327f110eefb509cfc833ecea0c6c3dfb..5f1f164218f3ed57647b1841d25d71e410c83a57 100755 --- a/python/examples/imdb/test_http_client.py +++ b/python/examples/imdb/test_http_client.py @@ -59,4 +59,4 @@ for line in sys.stdin: #print(feed) fetch = ["prediction"] fetch_map = client.predict(feed=feed, fetch=fetch, batch=True) - print("{} {}".format(fetch_map["prediction"][0], label[0])) + print(fetch_map) diff --git a/python/examples/lac/lac_http_client.py b/python/examples/lac/lac_http_client.py index c648e82fd5651f9a093d09ce5df83c31abda018c..b1a3418de1a006ac993eb1ee3d5f702dae959472 100755 --- a/python/examples/lac/lac_http_client.py +++ b/python/examples/lac/lac_http_client.py @@ -65,7 +65,3 @@ for line in sys.stdin: fetch=["crf_decode"], batch=True) print(fetch_map) - begin = fetch_map['crf_decode.lod'][0] - end = fetch_map['crf_decode.lod'][1] - segs = reader.parse_result(line, fetch_map["crf_decode"][begin:end]) - print("word_seg: " + "|".join(str(words) for words in segs))