diff --git a/deploy/pdserving/README_CN.md b/deploy/pdserving/README_CN.md index 28ec45a046bbceb512d124377c2dcb3cf4d3c417..7d6169569f92d927312ec6ba8ff667d613c4bfa7 100644 --- a/deploy/pdserving/README_CN.md +++ b/deploy/pdserving/README_CN.md @@ -6,7 +6,6 @@ PaddleOCR提供2种服务部署方式: - 基于PaddleHub Serving的部署:代码路径为"`./deploy/hubserving`",使用方法参考[文档](../../deploy/hubserving/readme.md); - 基于PaddleServing的部署:代码路径为"`./deploy/pdserving`",按照本教程使用。 -* AIStudio演示案例可参考 [基于PaddleServing的OCR服务化部署实战](https://aistudio.baidu.com/aistudio/projectdetail/3630726) # 基于PaddleServing的服务部署 @@ -19,6 +18,8 @@ PaddleOCR提供2种服务部署方式: 更多有关PaddleServing服务化部署框架介绍和使用教程参考[文档](https://github.com/PaddlePaddle/Serving/blob/develop/README_CN.md)。 +AIStudio演示案例可参考 [基于PaddleServing的OCR服务化部署实战](https://aistudio.baidu.com/aistudio/projectdetail/3630726)。 + ## 目录 - [环境准备](#环境准备) - [模型转换](#模型转换) @@ -133,7 +134,7 @@ python3 -m paddle_serving_client.convert --dirname ./ch_PP-OCRv2_rec_infer/ \ python3 pipeline_http_client.py ``` 成功运行后,模型预测的结果会打印在cmd窗口中,结果示例为: - ![](./imgs/results.png) + ![](./imgs/pipeline_result.png) 调整 config.yml 中的并发个数获得最大的QPS, 一般检测和识别的并发数为2:1 ``` diff --git a/deploy/pdserving/imgs/pipeline_result.png b/deploy/pdserving/imgs/pipeline_result.png new file mode 100644 index 0000000000000000000000000000000000000000..1058daa9b2b47ea88b835d7b2b3c49f131833f39 Binary files /dev/null and b/deploy/pdserving/imgs/pipeline_result.png differ diff --git a/deploy/pdserving/pipeline_http_client.py b/deploy/pdserving/pipeline_http_client.py index 61d13178220118eaf53c51723a9ef65201373ffb..a0ade26c716900d6f220c0dc1f4d8f8795b2dc55 100644 --- a/deploy/pdserving/pipeline_http_client.py +++ b/deploy/pdserving/pipeline_http_client.py @@ -34,12 +34,16 @@ test_img_dir = args.image_dir for idx, img_file in enumerate(os.listdir(test_img_dir)): with open(os.path.join(test_img_dir, img_file), 'rb') as file: image_data1 = file.read() + print('{}{}{}'.format('*' * 10, img_file, '*' * 10)) image = cv2_to_base64(image_data1) - for i in range(1): - data = {"key": ["image"], "value": [image]} - r = requests.post(url=url, data=json.dumps(data)) - print(r.json()) + data = {"key": ["image"], "value": [image]} + r = requests.post(url=url, data=json.dumps(data)) + all_result = r.json()["value"][0] + for item in eval(all_result): + print(item) + #print("len result:", len(result)) + #print(eval(result[0])) print("==> total number of test imgs: ", len(os.listdir(test_img_dir)))