未验证 提交 4def1068 编写于 作者: A andyjpaddle 提交者: GitHub

update cpp serving for v3 (#6207)

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