Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
c0076084
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c0076084
编写于
12月 14, 2016
作者:
G
gaoyuan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Format the python file.
上级
96009326
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
6 deletion
+18
-6
proto/ModelConfig.proto
proto/ModelConfig.proto
+0
-2
python/paddle/trainer/config_parser.py
python/paddle/trainer/config_parser.py
+3
-1
python/paddle/trainer_config_helpers/layers.py
python/paddle/trainer_config_helpers/layers.py
+15
-3
未找到文件。
proto/ModelConfig.proto
浏览文件 @
c0076084
...
...
@@ -253,8 +253,6 @@ message PriorBoxConfig {
repeated
uint32
max_size
=
2
;
repeated
float
aspect_ratio
=
3
;
repeated
float
variance
=
4
;
optional
bool
flip
=
5
[
default
=
true
];
optional
bool
clip
=
6
[
default
=
true
];
}
message
LayerInputConfig
{
...
...
python/paddle/trainer/config_parser.py
浏览文件 @
c0076084
...
...
@@ -1577,9 +1577,11 @@ class PrintLayer(LayerBase):
def
__init__
(
self
,
name
,
inputs
):
super
(
PrintLayer
,
self
).
__init__
(
name
,
'print'
,
0
,
inputs
)
@
config_layer
(
'priorbox'
)
class
PriorBoxLayer
(
LayerBase
):
def
__init__
(
self
,
name
,
inputs
,
size
,
min_size
,
max_size
,
aspect_ratio
,
variance
):
def
__init__
(
self
,
name
,
inputs
,
size
,
min_size
,
max_size
,
aspect_ratio
,
variance
):
super
(
PriorBoxLayer
,
self
).
__init__
(
name
,
'priorbox'
,
0
,
inputs
)
config_assert
(
len
(
inputs
)
==
2
,
'PriorBoxLayer must have 2 input'
)
self
.
config
.
inputs
[
0
].
priorbox_conf
.
min_size
.
extend
(
min_size
)
...
...
python/paddle/trainer_config_helpers/layers.py
浏览文件 @
c0076084
...
...
@@ -935,8 +935,15 @@ def print_layer(input, name=None):
inputs
=
[
l
.
name
for
l
in
input
],
)
# this layer don't return anything, can not be input of other layer.
@
wrap_name_default
(
"priorbox"
)
def
priorbox_layer
(
input
,
img_shape
,
aspect_ratio
,
variance
,
min_size
,
max_size
=
[],
name
=
None
):
def
priorbox_layer
(
input
,
img_shape
,
aspect_ratio
,
variance
,
min_size
,
max_size
=
[],
name
=
None
):
"""
Compute the priorbox and set the variance. This layer is necessary for ssd.
...
...
@@ -957,7 +964,7 @@ def priorbox_layer(input, img_shape, aspect_ratio, variance, min_size, max_size=
"""
# plus one for ratio 1.
num_filters
=
(
len
(
aspect_ratio
)
*
2
+
1
+
len
(
max_size
))
*
4
size
=
(
input
.
size
/
input
.
num_filters
)
*
num_filters
*
2
size
=
(
input
.
size
/
input
.
num_filters
)
*
num_filters
*
2
Layer
(
name
=
name
,
type
=
LayerType
.
PRIORBOX_LAYER
,
...
...
@@ -968,7 +975,12 @@ def priorbox_layer(input, img_shape, aspect_ratio, variance, min_size, max_size=
aspect_ratio
=
aspect_ratio
,
variance
=
variance
)
return
LayerOutput
(
name
,
LayerType
.
PRIORBOX_LAYER
,
parents
=
[
input
,
img_shape
],
num_filters
=
num_filters
,
size
=
size
)
name
,
LayerType
.
PRIORBOX_LAYER
,
parents
=
[
input
,
img_shape
],
num_filters
=
num_filters
,
size
=
size
)
@
wrap_name_default
(
"seq_pooling"
)
@
wrap_bias_attr_default
(
has_bias
=
False
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录