Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
bc7ea032
Commit
bc7ea032
authored
Apr 08, 2022
by
tink2123
Browse files
update result
parent
94d71d7f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
deploy/pdserving/README_CN.md
deploy/pdserving/README_CN.md
+3
-2
deploy/pdserving/imgs/pipeline_result.png
deploy/pdserving/imgs/pipeline_result.png
+0
-0
deploy/pdserving/pipeline_http_client.py
deploy/pdserving/pipeline_http_client.py
+8
-4
No files found.
deploy/pdserving/README_CN.md
View file @
bc7ea032
...
...
@@ -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/result
s
.png
)
!
[](
./imgs/
pipeline_
result.png
)
调整 config.yml 中的并发个数获得最大的QPS, 一般检测和识别的并发数为2:1
```
...
...
deploy/pdserving/imgs/pipeline_result.png
0 → 100644
View file @
bc7ea032
522 KB
deploy/pdserving/pipeline_http_client.py
View file @
bc7ea032
...
...
@@ -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
())
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
)))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment