Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleOCR
提交
f10c4580
P
PaddleOCR
项目概览
PaddlePaddle
/
PaddleOCR
大约 1 年 前同步成功
通知
1528
Star
32962
Fork
6643
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
108
列表
看板
标记
里程碑
合并请求
7
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
108
Issue
108
列表
看板
标记
里程碑
合并请求
7
合并请求
7
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
f10c4580
编写于
6月 08, 2022
作者:
X
xiaoting
提交者:
GitHub
6月 08, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update for serving (#6518)
上级
21d9f4bf
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
8 addition
and
11 deletion
+8
-11
deploy/pdserving/README.md
deploy/pdserving/README.md
+1
-1
deploy/pdserving/README_CN.md
deploy/pdserving/README_CN.md
+1
-1
deploy/pdserving/web_service.py
deploy/pdserving/web_service.py
+4
-3
test_tipc/test_serving_infer_cpp.sh
test_tipc/test_serving_infer_cpp.sh
+0
-2
test_tipc/test_serving_infer_python.sh
test_tipc/test_serving_infer_python.sh
+2
-4
未找到文件。
deploy/pdserving/README.md
浏览文件 @
f10c4580
...
...
@@ -136,7 +136,7 @@ The recognition model is the same.
2.
Run the following command to start the service.
```
# Start the service and save the running log in log.txt
python3 web_service.py &>log.txt &
python3 web_service.py
--config=config.yml
&>log.txt &
```
After the service is successfully started, a log similar to the following will be printed in log.txt
!
[](
./imgs/start_server.png
)
...
...
deploy/pdserving/README_CN.md
浏览文件 @
f10c4580
...
...
@@ -135,7 +135,7 @@ python3 -m paddle_serving_client.convert --dirname ./ch_PP-OCRv3_rec_infer/ \
2.
启动服务可运行如下命令:
```
# 启动服务,运行日志保存在log.txt
python3 web_service.py &>log.txt &
python3 web_service.py
--config=config.yml
&>log.txt &
```
成功启动服务后,log.txt中会打印类似如下日志
!
[](
./imgs/start_server.png
)
...
...
deploy/pdserving/web_service.py
浏览文件 @
f10c4580
...
...
@@ -19,7 +19,7 @@ import copy
import
cv2
import
base64
# from paddle_serving_app.reader import OCRReader
from
ocr_reader
import
OCRReader
,
DetResizeForTest
from
ocr_reader
import
OCRReader
,
DetResizeForTest
,
ArgsParser
from
paddle_serving_app.reader
import
Sequential
,
ResizeByFactor
from
paddle_serving_app.reader
import
Div
,
Normalize
,
Transpose
from
paddle_serving_app.reader
import
DBPostProcess
,
FilterBoxes
,
GetRotateCropImage
,
SortedBoxes
...
...
@@ -85,7 +85,7 @@ class RecOp(Op):
dt_boxes
=
copy
.
deepcopy
(
self
.
dt_list
)
feed_list
=
[]
img_list
=
[]
max_wh_ratio
=
320
/
48.
max_wh_ratio
=
320
/
48.
## Many mini-batchs, the type of feed_data is list.
max_batch_size
=
6
# len(dt_boxes)
...
...
@@ -163,5 +163,6 @@ class OcrService(WebService):
uci_service
=
OcrService
(
name
=
"ocr"
)
uci_service
.
prepare_pipeline_config
(
"config.yml"
)
FLAGS
=
ArgsParser
().
parse_args
()
uci_service
.
prepare_pipeline_config
(
yml_dict
=
FLAGS
.
conf_dict
)
uci_service
.
run_service
()
test_tipc/test_serving_infer_cpp.sh
浏览文件 @
f10c4580
...
...
@@ -106,8 +106,6 @@ function func_serving(){
cd
${
serving_dir_value
}
# cpp serving
unset
https_proxy
unset
http_proxy
for
gpu_id
in
${
gpu_value
[*]
}
;
do
if
[
${
gpu_id
}
=
"null"
]
;
then
if
[
${
model_name
}
=
"ch_PP-OCRv2"
]
||
[
${
model_name
}
=
"ch_PP-OCRv3"
]
||
[
${
model_name
}
=
"ch_ppocr_mobile_v2.0"
]
||
[
${
model_name
}
=
"ch_ppocr_server_v2.0"
]
;
then
...
...
test_tipc/test_serving_infer_python.sh
浏览文件 @
f10c4580
...
...
@@ -107,8 +107,6 @@ function func_serving(){
python_list
=(
${
python_list
}
)
cd
${
serving_dir_value
}
unset
https_proxy
unset
http_proxy
python
=
${
python_list
[0]
}
# python serving
...
...
@@ -147,7 +145,7 @@ function func_serving(){
status_check
$last_status
"
${
pipeline_cmd
}
"
"
${
status_log
}
"
"
${
model_name
}
"
sleep
2s
done
ps ux |
grep
-E
'web_service
|pipeline
'
|
awk
'{print $2}'
| xargs
kill
-s
9
ps ux |
grep
-E
'web_service'
|
awk
'{print $2}'
| xargs
kill
-s
9
done
done
elif
[
${
use_gpu
}
=
"gpu"
]
;
then
...
...
@@ -197,7 +195,7 @@ function func_serving(){
status_check
$last_status
"
${
pipeline_cmd
}
"
"
${
status_log
}
"
"
${
model_name
}
"
sleep
2s
done
ps ux |
grep
-E
'web_service
|pipeline
'
|
awk
'{print $2}'
| xargs
kill
-s
9
ps ux |
grep
-E
'web_service'
|
awk
'{print $2}'
| xargs
kill
-s
9
done
done
else
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录