提交 8502f132 编写于 作者: A andyjpaddle

update cpp serving for v3

上级 1e744e6b
...@@ -30,7 +30,7 @@ client.load_client_config(sys.argv[1:]) ...@@ -30,7 +30,7 @@ client.load_client_config(sys.argv[1:])
client.connect(["127.0.0.1:9293"]) client.connect(["127.0.0.1:9293"])
import paddle import paddle
test_img_dir = "test_img/" test_img_dir = "../../doc/imgs/"
ocr_reader = OCRReader(char_dict_path="../../ppocr/utils/ppocr_keys_v1.txt") ocr_reader = OCRReader(char_dict_path="../../ppocr/utils/ppocr_keys_v1.txt")
...@@ -45,8 +45,7 @@ for img_file in os.listdir(test_img_dir): ...@@ -45,8 +45,7 @@ for img_file in os.listdir(test_img_dir):
image_data = file.read() image_data = file.read()
image = cv2_to_base64(image_data) image = cv2_to_base64(image_data)
res_list = [] res_list = []
fetch_map = client.predict( fetch_map = client.predict(feed={"x": image}, fetch=[], batch=True)
feed={"x": image}, fetch=["save_infer_model/scale_0.tmp_1"], batch=True)
one_batch_res = ocr_reader.postprocess(fetch_map, with_score=True) one_batch_res = ocr_reader.postprocess(fetch_map, with_score=True)
for res in one_batch_res: for res in one_batch_res:
res_list.append(res[0]) res_list.append(res[0])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册