Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
72c6191e
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看板
提交
72c6191e
编写于
7月 01, 2020
作者:
W
wangjiawei04
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add blazeface
上级
e1391c50
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
28 addition
and
1 deletion
+28
-1
python/paddle_serving_app/models/model_list.py
python/paddle_serving_app/models/model_list.py
+2
-1
python/paddle_serving_app/reader/functional.py
python/paddle_serving_app/reader/functional.py
+1
-0
python/paddle_serving_app/reader/image_reader.py
python/paddle_serving_app/reader/image_reader.py
+25
-0
未找到文件。
python/paddle_serving_app/models/model_list.py
浏览文件 @
72c6191e
...
...
@@ -24,7 +24,8 @@ class ServingModels(object):
"SentimentAnalysis"
]
=
[
"senta_bilstm"
,
"senta_bow"
,
"senta_cnn"
]
self
.
model_dict
[
"SemanticRepresentation"
]
=
[
"ernie"
]
self
.
model_dict
[
"ChineseWordSegmentation"
]
=
[
"lac"
]
self
.
model_dict
[
"ObjectDetection"
]
=
[
"faster_rcnn"
,
"yolov4"
]
self
.
model_dict
[
"ObjectDetection"
]
=
[
"faster_rcnn"
,
"yolov4"
,
"blazeface"
]
self
.
model_dict
[
"ImageSegmentation"
]
=
[
"unet"
,
"deeplabv3"
,
"deeplabv3+cityscapes"
]
...
...
python/paddle_serving_app/reader/functional.py
浏览文件 @
72c6191e
...
...
@@ -29,6 +29,7 @@ def normalize(img, mean, std, channel_first):
else
:
img_mean
=
np
.
array
(
mean
).
reshape
((
1
,
1
,
3
))
img_std
=
np
.
array
(
std
).
reshape
((
1
,
1
,
3
))
img
=
np
.
array
(
img
).
astype
(
"float32"
)
img
-=
img_mean
img
/=
img_std
return
img
...
...
python/paddle_serving_app/reader/image_reader.py
浏览文件 @
72c6191e
...
...
@@ -440,8 +440,33 @@ class RCNNPostprocess(object):
self
.
label_file
,
self
.
output_dir
)
class
BlazeFacePostprocess
(
RCNNPostprocess
):
def
clip_bbox
(
self
,
bbox
,
im_size
=
None
):
h
=
1.
if
im_size
is
None
else
im_size
[
0
]
w
=
1.
if
im_size
is
None
else
im_size
[
1
]
xmin
=
max
(
min
(
bbox
[
0
],
w
),
0.
)
ymin
=
max
(
min
(
bbox
[
1
],
h
),
0.
)
xmax
=
max
(
min
(
bbox
[
2
],
w
),
0.
)
ymax
=
max
(
min
(
bbox
[
3
],
h
),
0.
)
return
xmin
,
ymin
,
xmax
,
ymax
def
_get_bbox_result
(
self
,
fetch_map
,
fetch_name
,
clsid2catid
):
result
=
{}
is_bbox_normalized
=
True
#for blaze face, set true here
output
=
fetch_map
[
fetch_name
]
lod
=
[
fetch_map
[
fetch_name
+
'.lod'
]]
lengths
=
self
.
_offset_to_lengths
(
lod
)
np_data
=
np
.
array
(
output
)
result
[
'bbox'
]
=
(
np_data
,
lengths
)
result
[
'im_id'
]
=
np
.
array
([[
0
]])
result
[
"im_shape"
]
=
np
.
array
(
fetch_map
[
"im_shape"
]).
astype
(
np
.
int32
)
bbox_results
=
self
.
_bbox2out
([
result
],
clsid2catid
,
is_bbox_normalized
)
return
bbox_results
class
Sequential
(
object
):
"""
Args:
sequence (sequence of ``Transform`` objects): list of transforms to chain.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录