Skip to content

Commit

Permalink
update cpp serving for v3 (PaddlePaddle#6207)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyjiang1116 committed May 9, 2022
1 parent 8f7518c commit 4def106
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions deploy/pdserving/ocr_cpp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
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")

Expand All @@ -45,8 +45,7 @@ def cv2_to_base64(image):
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])
Expand Down

0 comments on commit 4def106

Please sign in to comment.