Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
f811ba87
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,发现更多精彩内容 >>
提交
f811ba87
编写于
1月 21, 2022
作者:
A
Alexander Alekhin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #21429 from alalek:dnn_api_explicit_const_3.4
上级
e6127700
b3047302
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
113 addition
and
93 deletion
+113
-93
modules/dnn/include/opencv2/dnn/dict.hpp
modules/dnn/include/opencv2/dnn/dict.hpp
+7
-7
modules/dnn/include/opencv2/dnn/dnn.hpp
modules/dnn/include/opencv2/dnn/dnn.hpp
+23
-10
modules/dnn/src/dnn.cpp
modules/dnn/src/dnn.cpp
+80
-73
modules/dnn/src/dnn_common.hpp
modules/dnn/src/dnn_common.hpp
+2
-2
modules/dnn/src/layers/recurrent_layers.cpp
modules/dnn/src/layers/recurrent_layers.cpp
+1
-1
未找到文件。
modules/dnn/include/opencv2/dnn/dict.hpp
浏览文件 @
f811ba87
...
...
@@ -60,13 +60,13 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
struct
CV_EXPORTS_W
DictValue
{
DictValue
(
const
DictValue
&
r
);
DictValue
(
bool
i
)
:
type
(
Param
::
INT
),
pi
(
new
AutoBuffer
<
int64
,
1
>
)
{
(
*
pi
)[
0
]
=
i
?
1
:
0
;
}
//!< Constructs integer scalar
DictValue
(
int64
i
=
0
)
:
type
(
Param
::
INT
),
pi
(
new
AutoBuffer
<
int64
,
1
>
)
{
(
*
pi
)[
0
]
=
i
;
}
//!< Constructs integer scalar
CV_WRAP
DictValue
(
int
i
)
:
type
(
Param
::
INT
),
pi
(
new
AutoBuffer
<
int64
,
1
>
)
{
(
*
pi
)[
0
]
=
i
;
}
//!< Constructs integer scalar
DictValue
(
unsigned
p
)
:
type
(
Param
::
INT
),
pi
(
new
AutoBuffer
<
int64
,
1
>
)
{
(
*
pi
)[
0
]
=
p
;
}
//!< Constructs integer scalar
CV_WRAP
DictValue
(
double
p
)
:
type
(
Param
::
REAL
),
pd
(
new
AutoBuffer
<
double
,
1
>
)
{
(
*
pd
)[
0
]
=
p
;
}
//!< Constructs floating point scalar
CV_WRAP
DictValue
(
const
String
&
s
)
:
type
(
Param
::
STRING
),
ps
(
new
AutoBuffer
<
String
,
1
>
)
{
(
*
ps
)[
0
]
=
s
;
}
//!< Constructs string scalar
DictValue
(
const
char
*
s
)
:
type
(
Param
::
STRING
),
ps
(
new
AutoBuffer
<
String
,
1
>
)
{
(
*
ps
)[
0
]
=
s
;
}
//!< @overload
explicit
DictValue
(
bool
i
)
:
type
(
Param
::
INT
),
pi
(
new
AutoBuffer
<
int64
,
1
>
)
{
(
*
pi
)[
0
]
=
i
?
1
:
0
;
}
//!< Constructs integer scalar
explicit
DictValue
(
int64
i
=
0
)
:
type
(
Param
::
INT
),
pi
(
new
AutoBuffer
<
int64
,
1
>
)
{
(
*
pi
)[
0
]
=
i
;
}
//!< Constructs integer scalar
CV_WRAP
explicit
DictValue
(
int
i
)
:
type
(
Param
::
INT
),
pi
(
new
AutoBuffer
<
int64
,
1
>
)
{
(
*
pi
)[
0
]
=
i
;
}
//!< Constructs integer scalar
explicit
DictValue
(
unsigned
p
)
:
type
(
Param
::
INT
),
pi
(
new
AutoBuffer
<
int64
,
1
>
)
{
(
*
pi
)[
0
]
=
p
;
}
//!< Constructs integer scalar
CV_WRAP
explicit
DictValue
(
double
p
)
:
type
(
Param
::
REAL
),
pd
(
new
AutoBuffer
<
double
,
1
>
)
{
(
*
pd
)[
0
]
=
p
;
}
//!< Constructs floating point scalar
CV_WRAP
explicit
DictValue
(
const
String
&
s
)
:
type
(
Param
::
STRING
),
ps
(
new
AutoBuffer
<
String
,
1
>
)
{
(
*
ps
)[
0
]
=
s
;
}
//!< Constructs string scalar
explicit
DictValue
(
const
char
*
s
)
:
type
(
Param
::
STRING
),
ps
(
new
AutoBuffer
<
String
,
1
>
)
{
(
*
ps
)[
0
]
=
s
;
}
//!< @overload
template
<
typename
TypeIter
>
static
DictValue
arrayInt
(
TypeIter
begin
,
int
size
);
//!< Constructs integer array
...
...
modules/dnn/include/opencv2/dnn/dnn.hpp
浏览文件 @
f811ba87
...
...
@@ -125,7 +125,7 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
class
BackendNode
{
public:
BackendNode
(
int
backendId
);
explicit
BackendNode
(
int
backendId
);
virtual
~
BackendNode
();
//!< Virtual destructor to make polymorphism.
...
...
@@ -259,18 +259,18 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
* Each layer input and output can be labeled to easily identify them using "%<layer_name%>[.output_name]" notation.
* This method maps label of input blob to its index into input vector.
*/
virtual
int
inputNameToIndex
(
String
inputName
);
virtual
int
inputNameToIndex
(
String
inputName
);
// FIXIT const
/** @brief Returns index of output blob in output array.
* @see inputNameToIndex()
*/
CV_WRAP
virtual
int
outputNameToIndex
(
const
String
&
outputName
);
CV_WRAP
virtual
int
outputNameToIndex
(
const
String
&
outputName
);
// FIXIT const
/**
* @brief Ask layer if it support specific backend for doing computations.
* @param[in] backendId computation backend identifier.
* @see Backend
*/
virtual
bool
supportBackend
(
int
backendId
);
virtual
bool
supportBackend
(
int
backendId
);
// FIXIT const
/**
* @brief Returns Halide backend node.
...
...
@@ -442,18 +442,29 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
/** @brief Converts string name of the layer to the integer identifier.
* @returns id of the layer, or -1 if the layer wasn't found.
*/
CV_WRAP
int
getLayerId
(
const
String
&
layer
);
CV_WRAP
int
getLayerId
(
const
String
&
layer
)
const
;
CV_WRAP
std
::
vector
<
String
>
getLayerNames
()
const
;
/** @brief Container for strings and integers. */
/** @brief Container for strings and integers.
*
* @deprecated Use getLayerId() with int result.
*/
typedef
DictValue
LayerId
;
/** @brief Returns pointer to layer with specified id or name which the network use. */
CV_WRAP
Ptr
<
Layer
>
getLayer
(
LayerId
layerId
);
CV_WRAP
Ptr
<
Layer
>
getLayer
(
int
layerId
)
const
;
/** @overload
* @deprecated Use int getLayerId(const String &layer)
*/
CV_WRAP
inline
Ptr
<
Layer
>
getLayer
(
const
String
&
layerName
)
const
{
return
getLayer
(
getLayerId
(
layerName
));
}
/** @overload
* @deprecated to be removed
*/
CV_WRAP
Ptr
<
Layer
>
getLayer
(
const
LayerId
&
layerId
)
const
;
/** @brief Returns pointers to input layers of specific layer. */
std
::
vector
<
Ptr
<
Layer
>
>
getLayerInputs
(
LayerId
layerId
)
;
// FIXIT: CV_WRAP
std
::
vector
<
Ptr
<
Layer
>
>
getLayerInputs
(
int
layerId
)
const
;
// FIXIT: CV_WRAP
/** @brief Connects output of the first layer to input of the second layer.
* @param outPin descriptor of the first layer output.
...
...
@@ -587,14 +598,16 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
* @note If shape of the new blob differs from the previous shape,
* then the following forward pass may fail.
*/
CV_WRAP
void
setParam
(
LayerId
layer
,
int
numParam
,
const
Mat
&
blob
);
CV_WRAP
void
setParam
(
int
layer
,
int
numParam
,
const
Mat
&
blob
);
CV_WRAP
inline
void
setParam
(
const
String
&
layerName
,
int
numParam
,
const
Mat
&
blob
)
{
return
setParam
(
getLayerId
(
layerName
),
numParam
,
blob
);
}
/** @brief Returns parameter blob of the layer.
* @param layer name or id of the layer.
* @param numParam index of the layer parameter in the Layer::blobs array.
* @see Layer::blobs
*/
CV_WRAP
Mat
getParam
(
LayerId
layer
,
int
numParam
=
0
);
CV_WRAP
Mat
getParam
(
int
layer
,
int
numParam
=
0
)
const
;
CV_WRAP
inline
Mat
getParam
(
const
String
&
layerName
,
int
numParam
=
0
)
const
{
return
getParam
(
getLayerId
(
layerName
),
numParam
);
}
/** @brief Returns indexes of layers with unconnected outputs.
*/
...
...
modules/dnn/src/dnn.cpp
浏览文件 @
f811ba87
此差异已折叠。
点击以展开。
modules/dnn/src/dnn_common.hpp
浏览文件 @
f811ba87
...
...
@@ -19,12 +19,12 @@ namespace detail {
struct
NetImplBase
{
const
int
networkId
;
// network global identifier
int
networkDumpCounter
;
// dump counter
mutable
int
networkDumpCounter
;
// dump counter
int
dumpLevel
;
// level of information dumps (initialized through OPENCV_DNN_NETWORK_DUMP parameter)
NetImplBase
();
std
::
string
getDumpFileNameBase
();
std
::
string
getDumpFileNameBase
()
const
;
};
}
// namespace detail
...
...
modules/dnn/src/layers/recurrent_layers.cpp
浏览文件 @
f811ba87
...
...
@@ -184,7 +184,7 @@ public:
CV_Assert
(
!
reverse
||
!
bidirectional
);
// read activations
DictValue
activations
=
params
.
get
<
DictValue
>
(
"activations"
,
""
);
DictValue
activations
=
params
.
get
<
DictValue
>
(
"activations"
,
DictValue
(
String
())
);
if
(
activations
.
size
()
==
1
)
// if activations wasn't specified use default
{
f_activation
=
sigmoid
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录