Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
6a2b0695
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 1 年 前同步成功
通知
186
Star
833
Fork
253
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
105
列表
看板
标记
里程碑
合并请求
10
Wiki
2
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Serving
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
105
Issue
105
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
2
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6a2b0695
编写于
4月 24, 2020
作者:
W
wangjiawei04
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
move pddet to app/pddet and remove arg parse
上级
7a6f5c82
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
28 addition
and
12 deletion
+28
-12
python/examples/faster_rcnn_model/test_client.py
python/examples/faster_rcnn_model/test_client.py
+4
-6
python/paddle_serving_app/reader/pddet/__init__.py
python/paddle_serving_app/reader/pddet/__init__.py
+18
-0
python/paddle_serving_app/reader/pddet/image_tool.py
python/paddle_serving_app/reader/pddet/image_tool.py
+3
-3
python/setup.py.app.in
python/setup.py.app.in
+3
-3
未找到文件。
python/examples/faster_rcnn_model/test_client.py
浏览文件 @
6a2b0695
...
...
@@ -16,19 +16,17 @@ from paddle_serving_client import Client
import
sys
import
os
import
time
from
paddle_serving_app.
pddet
import
Detection
,
ArgParse
from
paddle_serving_app.
reader.pddet
import
Detection
import
numpy
as
np
py_version
=
sys
.
version_info
[
0
]
feed_var_names
=
[
'image'
,
'im_shape'
,
'im_info'
]
fetch_var_names
=
[
'multiclass_nms'
]
FLAGS
=
ArgParse
()
pddet
=
Detection
(
FLAGS
.
config_path
,
FLAGS
.
visualize
,
FLAGS
.
dump_result
,
FLAGS
.
output_dir
)
feed_dict
=
pddet
.
preprocess
(
feed_var_names
,
FLAGS
.
infer_img
)
pddet
=
Detection
(
config_path
=
sys
.
argv
[
2
],
output_dir
=
"./output"
)
feed_dict
=
pddet
.
preprocess
(
feed_var_names
,
sys
.
argv
[
3
])
client
=
Client
()
client
.
load_client_config
(
FLAGS
.
serving_client_conf
)
client
.
load_client_config
(
sys
.
argv
[
1
]
)
client
.
connect
([
'127.0.0.1:9494'
])
fetch_map
=
client
.
predict
(
feed
=
feed_dict
,
fetch
=
fetch_var_names
)
outs
=
fetch_map
.
values
()
...
...
python/paddle_serving_app/pddet/__init__.py
→
python/paddle_serving_app/
reader/
pddet/__init__.py
浏览文件 @
6a2b0695
...
...
@@ -16,34 +16,3 @@ import os
import
time
import
argparse
from
.image_tool
import
Resize
,
Detection
def
ArgParse
():
parser
=
argparse
.
ArgumentParser
(
description
=
__doc__
)
parser
.
add_argument
(
"--config_path"
,
type
=
str
,
default
=
None
,
help
=
"preprocess config path."
)
parser
.
add_argument
(
"--infer_img"
,
type
=
str
,
default
=
None
,
help
=
"Image path"
)
parser
.
add_argument
(
"--visualize"
,
action
=
'store_true'
,
default
=
False
,
help
=
"Whether to visualize detection output"
)
parser
.
add_argument
(
"--output_dir"
,
type
=
str
,
default
=
"output"
,
help
=
"Directory for storing the output visualization files."
)
parser
.
add_argument
(
"--serving_client_conf"
,
type
=
str
,
default
=
'pddet_client_conf/serving_client_conf.prototxt'
,
help
=
'Paddle Serving Client configuration'
)
parser
.
add_argument
(
"--dump_result"
,
action
=
'store_true'
,
default
=
False
,
help
=
"Whether to dump result"
)
global
FLAGS
FLAGS
=
parser
.
parse_args
()
return
FLAGS
python/paddle_serving_app/pddet/image_tool.py
→
python/paddle_serving_app/
reader/
pddet/image_tool.py
浏览文件 @
6a2b0695
...
...
@@ -151,10 +151,10 @@ class PadStride(object):
class
Detection
():
def
__init__
(
self
,
config_path
,
if_visualize
,
if_dump_result
,
output_dir
):
def
__init__
(
self
,
config_path
,
output_dir
):
self
.
config_path
=
config_path
self
.
if_visualize
=
if_visualiz
e
self
.
if_dump_result
=
if_dump_result
self
.
if_visualize
=
Tru
e
self
.
if_dump_result
=
True
self
.
output_dir
=
output_dir
def
DecodeImage
(
self
,
im_path
):
...
...
python/setup.py.app.in
浏览文件 @
6a2b0695
...
...
@@ -48,7 +48,7 @@ REQUIRED_PACKAGES = [
packages=['paddle_serving_app',
'paddle_serving_app.reader',
'paddle_serving_app.utils',
'paddle_serving_app.pddet']
'paddle_serving_app.
reader.
pddet']
package_data={}
package_dir={'paddle_serving_app':
...
...
@@ -57,8 +57,8 @@ package_dir={'paddle_serving_app':
'${PADDLE_SERVING_BINARY_DIR}/python/paddle_serving_app/reader',
'paddle_serving_app.utils':
'${PADDLE_SERVING_BINARY_DIR}/python/paddle_serving_app/utils',
'paddle_serving_app.pddet':
'${PADDLE_SERVING_BINARY_DIR}/python/paddle_serving_app/pddet',}
'paddle_serving_app.
reader.
pddet':
'${PADDLE_SERVING_BINARY_DIR}/python/paddle_serving_app/
reader/
pddet',}
setup(
name='paddle-serving-app',
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录