Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
050916fd
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
050916fd
编写于
10月 10, 2017
作者:
V
Vladislav Sovrasov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dnn: modify priorBox layer
上级
af8ed9d0
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
555 addition
and
411 deletion
+555
-411
modules/dnn/misc/caffe/caffe.pb.cc
modules/dnn/misc/caffe/caffe.pb.cc
+472
-411
modules/dnn/misc/caffe/caffe.pb.h
modules/dnn/misc/caffe/caffe.pb.h
+34
-0
modules/dnn/src/caffe/caffe.proto
modules/dnn/src/caffe/caffe.proto
+2
-0
modules/dnn/src/layers/prior_box_layer.cpp
modules/dnn/src/layers/prior_box_layer.cpp
+47
-0
未找到文件。
modules/dnn/misc/caffe/caffe.pb.cc
浏览文件 @
050916fd
此差异已折叠。
点击以展开。
modules/dnn/misc/caffe/caffe.pb.h
浏览文件 @
050916fd
...
...
@@ -1537,6 +1537,13 @@ class PriorBoxParameter : public ::google::protobuf::Message /* @@protoc_inserti
float offset() const;
void set_offset(float value);
// optional bool additional_y_offset = 14 [default = false];
bool has_additional_y_offset() const;
void clear_additional_y_offset();
static const int kAdditionalYOffsetFieldNumber = 14;
bool additional_y_offset() const;
void set_additional_y_offset(bool value);
// @@protoc_insertion_point(class_scope:caffe.PriorBoxParameter)
private:
inline void set_has_min_size();
...
...
@@ -1561,6 +1568,8 @@ class PriorBoxParameter : public ::google::protobuf::Message /* @@protoc_inserti
inline void clear_has_step_w();
inline void set_has_offset();
inline void clear_has_offset();
inline void set_has_additional_y_offset();
inline void clear_has_additional_y_offset();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
::google::protobuf::internal::HasBits<1> _has_bits_;
...
...
@@ -1575,6 +1584,7 @@ class PriorBoxParameter : public ::google::protobuf::Message /* @@protoc_inserti
float step_;
float step_h_;
float step_w_;
bool additional_y_offset_;
bool flip_;
bool clip_;
float offset_;
...
...
@@ -13635,6 +13645,30 @@ inline void PriorBoxParameter::set_offset(float value) {
// @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.offset)
}
// optional bool additional_y_offset = 14 [default = false];
inline bool PriorBoxParameter::has_additional_y_offset() const {
return (_has_bits_[0] & 0x00002000u) != 0;
}
inline void PriorBoxParameter::set_has_additional_y_offset() {
_has_bits_[0] |= 0x00002000u;
}
inline void PriorBoxParameter::clear_has_additional_y_offset() {
_has_bits_[0] &= ~0x00002000u;
}
inline void PriorBoxParameter::clear_additional_y_offset() {
additional_y_offset_ = false;
clear_has_additional_y_offset();
}
inline bool PriorBoxParameter::additional_y_offset() const {
// @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.additional_y_offset)
return additional_y_offset_;
}
inline void PriorBoxParameter::set_additional_y_offset(bool value) {
set_has_additional_y_offset();
additional_y_offset_ = value;
// @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.additional_y_offset)
}
inline const PriorBoxParameter* PriorBoxParameter::internal_default_instance() {
return &PriorBoxParameter_default_instance_.get();
}
modules/dnn/src/caffe/caffe.proto
浏览文件 @
050916fd
...
...
@@ -145,6 +145,8 @@ message PriorBoxParameter {
optional
float
step_w
=
12
;
// Offset to the top left corner of each cell.
optional
float
offset
=
13
[
default
=
0.5
];
// If true, two additional boxes for each center will be generated. Their centers will be shifted by y coordinate.
optional
bool
additional_y_offset
=
14
[
default
=
false
];
}
// Message that store parameters used by DetectionOutputLayer
...
...
modules/dnn/src/layers/prior_box_layer.cpp
浏览文件 @
050916fd
...
...
@@ -216,6 +216,14 @@ public:
_stepY
=
0
;
_stepX
=
0
;
}
if
(
params
.
has
(
"additional_y_offset"
))
{
_additional_y_offset
=
getParameter
<
bool
>
(
params
,
"additional_y_offset"
);
if
(
_additional_y_offset
)
_numPriors
*=
2
;
}
else
_additional_y_offset
=
false
;
}
bool
getMemoryShapes
(
const
std
::
vector
<
MatShape
>
&
inputs
,
...
...
@@ -289,6 +297,19 @@ public:
// ymax
outputPtr
[
idx
++
]
=
(
center_y
+
_boxHeight
/
2.
)
/
_imageHeight
;
if
(
_additional_y_offset
)
{
float
center_y_offset_1
=
(
h
+
1.0
)
*
stepY
;
// xmin
outputPtr
[
idx
++
]
=
(
center_x
-
_boxWidth
/
2.
)
/
_imageWidth
;
// ymin
outputPtr
[
idx
++
]
=
(
center_y_offset_1
-
_boxHeight
/
2.
)
/
_imageHeight
;
// xmax
outputPtr
[
idx
++
]
=
(
center_x
+
_boxWidth
/
2.
)
/
_imageWidth
;
// ymax
outputPtr
[
idx
++
]
=
(
center_y_offset_1
+
_boxHeight
/
2.
)
/
_imageHeight
;
}
if
(
_maxSize
>
0
)
{
// second prior: aspect_ratio = 1, size = sqrt(min_size * max_size)
...
...
@@ -301,6 +322,19 @@ public:
outputPtr
[
idx
++
]
=
(
center_x
+
_boxWidth
/
2.
)
/
_imageWidth
;
// ymax
outputPtr
[
idx
++
]
=
(
center_y
+
_boxHeight
/
2.
)
/
_imageHeight
;
if
(
_additional_y_offset
)
{
float
center_y_offset_1
=
(
h
+
1.0
)
*
stepY
;
// xmin
outputPtr
[
idx
++
]
=
(
center_x
-
_boxWidth
/
2.
)
/
_imageWidth
;
// ymin
outputPtr
[
idx
++
]
=
(
center_y_offset_1
-
_boxHeight
/
2.
)
/
_imageHeight
;
// xmax
outputPtr
[
idx
++
]
=
(
center_x
+
_boxWidth
/
2.
)
/
_imageWidth
;
// ymax
outputPtr
[
idx
++
]
=
(
center_y_offset_1
+
_boxHeight
/
2.
)
/
_imageHeight
;
}
}
// rest of priors
...
...
@@ -319,6 +353,18 @@ public:
outputPtr
[
idx
++
]
=
(
center_x
+
_boxWidth
/
2.
)
/
_imageWidth
;
// ymax
outputPtr
[
idx
++
]
=
(
center_y
+
_boxHeight
/
2.
)
/
_imageHeight
;
if
(
_additional_y_offset
)
{
float
center_y_offset_1
=
(
h
+
1.0
)
*
stepY
;
// xmin
outputPtr
[
idx
++
]
=
(
center_x
-
_boxWidth
/
2.
)
/
_imageWidth
;
// ymin
outputPtr
[
idx
++
]
=
(
center_y_offset_1
-
_boxHeight
/
2.
)
/
_imageHeight
;
// xmax
outputPtr
[
idx
++
]
=
(
center_x
+
_boxWidth
/
2.
)
/
_imageWidth
;
// ymax
outputPtr
[
idx
++
]
=
(
center_y_offset_1
+
_boxHeight
/
2.
)
/
_imageHeight
;
}
}
}
}
...
...
@@ -385,6 +431,7 @@ public:
bool
_flip
;
bool
_clip
;
bool
_additional_y_offset
;
size_t
_numPriors
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录