Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
104502c5
O
Opencv
项目概览
Greenplum
/
Opencv
10 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
提交
104502c5
编写于
1月 26, 2018
作者:
A
Alexander Alekhin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #10676 from dkurt:dnn_for_newer_mobilenet_ssd
上级
d1b08486
9e9926a2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
16 deletion
+20
-16
modules/dnn/src/layers/prior_box_layer.cpp
modules/dnn/src/layers/prior_box_layer.cpp
+10
-0
modules/dnn/src/tensorflow/tf_importer.cpp
modules/dnn/src/tensorflow/tf_importer.cpp
+10
-16
未找到文件。
modules/dnn/src/layers/prior_box_layer.cpp
浏览文件 @
104502c5
...
...
@@ -416,6 +416,11 @@ public:
{
_boxWidth
=
_widths
[
0
]
*
_scales
[
0
];
_boxHeight
=
_heights
[
0
]
*
_scales
[
0
];
if
(
_bboxesNormalized
)
{
_boxWidth
*=
_imageWidth
;
_boxHeight
*=
_imageHeight
;
}
}
else
_boxWidth
=
_boxHeight
=
_minSize
*
_scales
[
0
];
...
...
@@ -463,6 +468,11 @@ public:
{
_boxWidth
=
_widths
[
i
]
*
_scales
[
i
];
_boxHeight
=
_heights
[
i
]
*
_scales
[
i
];
if
(
_bboxesNormalized
)
{
_boxWidth
*=
_imageWidth
;
_boxHeight
*=
_imageHeight
;
}
for
(
int
j
=
0
;
j
<
_offsetsX
.
size
();
++
j
)
{
float
center_x
=
(
w
+
_offsetsX
[
j
])
*
stepX
;
...
...
modules/dnn/src/tensorflow/tf_importer.cpp
浏览文件 @
104502c5
...
...
@@ -1411,23 +1411,17 @@ void TFImporter::populateNet(Net dstNet)
layerParams
.
set
(
"clip"
,
getLayerAttr
(
layer
,
"clip"
).
b
());
if
(
hasLayerAttr
(
layer
,
"offset"
))
layerParams
.
set
(
"offset"
,
getLayerAttr
(
layer
,
"offset"
).
f
());
if
(
hasLayerAttr
(
layer
,
"variance"
))
{
Mat
variance
=
getTensorContent
(
getLayerAttr
(
layer
,
"variance"
).
tensor
());
layerParams
.
set
(
"variance"
,
DictValue
::
arrayReal
<
float
*>
((
float
*
)
variance
.
data
,
variance
.
total
()));
}
if
(
hasLayerAttr
(
layer
,
"aspect_ratio"
))
{
Mat
aspectRatios
=
getTensorContent
(
getLayerAttr
(
layer
,
"aspect_ratio"
).
tensor
());
layerParams
.
set
(
"aspect_ratio"
,
DictValue
::
arrayReal
<
float
*>
((
float
*
)
aspectRatios
.
data
,
aspectRatios
.
total
()));
}
if
(
hasLayerAttr
(
layer
,
"scales"
))
const
std
::
string
paramNames
[]
=
{
"variance"
,
"aspect_ratio"
,
"scales"
,
"width"
,
"height"
};
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
Mat
scales
=
getTensorContent
(
getLayerAttr
(
layer
,
"scales"
).
tensor
());
layerParams
.
set
(
"scales"
,
DictValue
::
arrayReal
<
float
*>
((
float
*
)
scales
.
data
,
scales
.
total
()));
if
(
hasLayerAttr
(
layer
,
paramNames
[
i
]))
{
Mat
values
=
getTensorContent
(
getLayerAttr
(
layer
,
paramNames
[
i
]).
tensor
());
layerParams
.
set
(
paramNames
[
i
],
DictValue
::
arrayReal
<
float
*>
((
float
*
)
values
.
data
,
values
.
total
()));
}
}
int
id
=
dstNet
.
addLayer
(
name
,
"PriorBox"
,
layerParams
);
layer_id
[
name
]
=
id
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录