Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
自由之枫~
opencv
提交
d9bf522b
O
opencv
项目概览
自由之枫~
/
opencv
与 Fork 源项目一致
Fork自
OpenCV / opencv
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d9bf522b
编写于
5月 23, 2022
作者:
A
Alexander Alekhin
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
上级
7e845a3b
93dc0679
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
59 addition
and
15 deletion
+59
-15
3rdparty/libpng/CMakeLists.txt
3rdparty/libpng/CMakeLists.txt
+5
-3
3rdparty/libtiff/CMakeLists.txt
3rdparty/libtiff/CMakeLists.txt
+3
-2
apps/traincascade/cascadeclassifier.cpp
apps/traincascade/cascadeclassifier.cpp
+1
-1
modules/dnn/src/onnx/onnx_importer.cpp
modules/dnn/src/onnx/onnx_importer.cpp
+21
-3
modules/dnn/test/test_int8_layers.cpp
modules/dnn/test/test_int8_layers.cpp
+20
-2
modules/dnn/test/test_onnx_importer.cpp
modules/dnn/test/test_onnx_importer.cpp
+5
-0
modules/ts/src/ts_gtest.cpp
modules/ts/src/ts_gtest.cpp
+1
-1
modules/video/src/tracking/tracker_dasiamrpn.cpp
modules/video/src/tracking/tracker_dasiamrpn.cpp
+3
-3
未找到文件。
3rdparty/libpng/CMakeLists.txt
浏览文件 @
d9bf522b
...
...
@@ -77,9 +77,11 @@ endif(MSVC)
add_library
(
${
PNG_LIBRARY
}
STATIC
${
OPENCV_3RDPARTY_EXCLUDE_FROM_ALL
}
${
lib_srcs
}
${
lib_hdrs
}
)
target_link_libraries
(
${
PNG_LIBRARY
}
${
ZLIB_LIBRARIES
}
)
ocv_warnings_disable
(
CMAKE_C_FLAGS -Wundef -Wcast-align -Wimplicit-fallthrough -Wunused-parameter -Wsign-compare
)
ocv_warnings_disable
(
CMAKE_C_FLAGS -Wnull-pointer-subtraction
)
# clang15
ocv_warnings_disable
(
CMAKE_C_FLAGS -Wunused-but-set-variable
)
# clang15
ocv_warnings_disable
(
CMAKE_C_FLAGS -Wundef -Wcast-align -Wimplicit-fallthrough -Wunused-parameter -Wsign-compare
-Wmaybe-uninitialized
-Wnull-pointer-subtraction
# clang15
-Wunused-but-set-variable
# clang15
)
set_target_properties
(
${
PNG_LIBRARY
}
PROPERTIES OUTPUT_NAME
${
PNG_LIBRARY
}
...
...
3rdparty/libtiff/CMakeLists.txt
浏览文件 @
d9bf522b
...
...
@@ -452,9 +452,10 @@ ocv_warnings_disable(CMAKE_C_FLAGS -Wno-unused-but-set-variable -Wmissing-protot
-Wcast-align -Wshadow -Wno-maybe-uninitialized -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast
-Wmisleading-indentation
-Wimplicit-fallthrough
-Wunused-parameter
# clang
-Warray-parameter
-Wstrict-prototypes
# clang15
)
ocv_warnings_disable
(
CMAKE_C_FLAGS -Wunused-parameter
)
# clang
ocv_warnings_disable
(
CMAKE_C_FLAGS -Wstrict-prototypes
)
# clang15
ocv_warnings_disable
(
CMAKE_CXX_FLAGS -Wmissing-declarations -Wunused-parameter -Wmissing-prototypes
-Wundef
# tiffiop.h: #if __clang_major__ >= 4
)
...
...
apps/traincascade/cascadeclassifier.cpp
浏览文件 @
d9bf522b
...
...
@@ -252,7 +252,7 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
fs
<<
"}"
;
}
// save current stage
char
buf
[
10
];
char
buf
[
32
];
sprintf
(
buf
,
"%s%d"
,
"stage"
,
i
);
string
stageFilename
=
dirName
+
buf
+
".xml"
;
FileStorage
fs
(
stageFilename
,
FileStorage
::
WRITE
);
...
...
modules/dnn/src/onnx/onnx_importer.cpp
浏览文件 @
d9bf522b
...
...
@@ -197,8 +197,18 @@ private:
void
parseOperatorSet
();
const
std
::
string
str_domain_ai_onnx
=
"ai.onnx"
;
bool
useLegacyNames
;
bool
getParamUseLegacyNames
()
{
bool
param
=
utils
::
getConfigurationParameterBool
(
"OPENCV_DNN_ONNX_USE_LEGACY_NAMES"
,
false
);
return
param
;
}
const
std
::
string
extractNodeName
(
const
opencv_onnx
::
NodeProto
&
node_proto
);
};
class
ONNXLayerHandler
:
public
detail
::
LayerHandler
{
public:
...
...
@@ -233,6 +243,7 @@ ONNXImporter::ONNXImporter(Net& net, const char *onnxFile)
:
layerHandler
(
DNN_DIAGNOSTICS_RUN
?
new
ONNXLayerHandler
(
this
)
:
nullptr
)
,
dstNet
(
net
)
,
onnx_opset
(
0
)
,
useLegacyNames
(
getParamUseLegacyNames
())
{
hasDynamicShapes
=
false
;
CV_Assert
(
onnxFile
);
...
...
@@ -256,6 +267,7 @@ ONNXImporter::ONNXImporter(Net& net, const char* buffer, size_t sizeBuffer)
:
layerHandler
(
DNN_DIAGNOSTICS_RUN
?
new
ONNXLayerHandler
(
this
)
:
nullptr
)
,
dstNet
(
net
)
,
onnx_opset
(
0
)
,
useLegacyNames
(
getParamUseLegacyNames
())
{
hasDynamicShapes
=
false
;
CV_LOG_DEBUG
(
NULL
,
"DNN/ONNX: processing in-memory ONNX model ("
<<
sizeBuffer
<<
" bytes)"
);
...
...
@@ -278,6 +290,7 @@ ONNXImporter::ONNXImporter(Net& net, const char* buffer, size_t sizeBuffer)
populateNet
();
}
inline
void
replaceLayerParam
(
LayerParams
&
layerParams
,
const
String
&
oldKey
,
const
String
&
newKey
)
{
if
(
layerParams
.
has
(
oldKey
))
{
...
...
@@ -909,11 +922,14 @@ const ONNXImporter::DispatchMap& ONNXImporter::getDispatchMap(const opencv_onnx:
return
it
->
second
;
}
const
std
::
string
&
extractNodeName
(
const
opencv_onnx
::
NodeProto
&
node_proto
)
const
std
::
string
ONNXImporter
::
extractNodeName
(
const
opencv_onnx
::
NodeProto
&
node_proto
)
{
// We need to rework DNN outputs API, this is a workaround for #21698
if
(
node_proto
.
has_name
()
&&
!
node_proto
.
name
().
empty
())
{
return
node_proto
.
name
();
if
(
useLegacyNames
)
return
node_proto
.
name
();
return
cv
::
format
(
"onnx_node!%s"
,
node_proto
.
name
().
c_str
());
}
for
(
int
i
=
0
;
i
<
node_proto
.
output_size
();
++
i
)
{
...
...
@@ -923,7 +939,9 @@ const std::string& extractNodeName(const opencv_onnx::NodeProto& node_proto)
// the second method is to use an empty string in place of an input or output name.
if
(
!
name
.
empty
())
{
return
name
;
if
(
useLegacyNames
)
return
name
.
c_str
();
return
cv
::
format
(
"onnx_node_output_%d!%s"
,
i
,
name
.
c_str
());
}
}
CV_Error
(
Error
::
StsAssert
,
"Couldn't deduce Node name."
);
...
...
modules/dnn/test/test_int8_layers.cpp
浏览文件 @
d9bf522b
...
...
@@ -265,14 +265,32 @@ TEST_P(Test_Int8_layers, Mish)
testLayer
(
"mish"
,
"ONNX"
,
0.0015
,
0.0025
);
}
TEST_P
(
Test_Int8_layers
,
Softmax
)
TEST_P
(
Test_Int8_layers
,
Softmax
_Caffe
)
{
testLayer
(
"layer_softmax"
,
"Caffe"
,
0.0011
,
0.0036
);
}
TEST_P
(
Test_Int8_layers
,
Softmax_keras_TF
)
{
testLayer
(
"keras_softmax"
,
"TensorFlow"
,
0.00093
,
0.0027
);
}
TEST_P
(
Test_Int8_layers
,
Softmax_slim_TF
)
{
testLayer
(
"slim_softmax"
,
"TensorFlow"
,
0.0016
,
0.0034
);
}
TEST_P
(
Test_Int8_layers
,
Softmax_slim_v2_TF
)
{
testLayer
(
"slim_softmax_v2"
,
"TensorFlow"
,
0.0029
,
0.017
);
}
TEST_P
(
Test_Int8_layers
,
Softmax_ONNX
)
{
testLayer
(
"softmax"
,
"ONNX"
,
0.0016
,
0.0028
);
}
TEST_P
(
Test_Int8_layers
,
Softmax_log_ONNX
)
{
testLayer
(
"log_softmax"
,
"ONNX"
,
0.014
,
0.025
);
}
TEST_P
(
Test_Int8_layers
,
DISABLED_Softmax_unfused_ONNX
)
// FIXIT Support 'Identity' layer for outputs (#22022)
{
testLayer
(
"softmax_unfused"
,
"ONNX"
,
0.0009
,
0.0021
);
}
...
...
@@ -389,7 +407,7 @@ TEST_P(Test_Int8_layers, Slice_strided_tf)
testLayer
(
"strided_slice"
,
"TensorFlow"
,
0.008
,
0.0142
);
}
TEST_P
(
Test_Int8_layers
,
Slice_onnx
)
TEST_P
(
Test_Int8_layers
,
DISABLED_Slice_onnx
)
// FIXIT Support 'Identity' layer for outputs (#22022
)
{
testLayer
(
"slice"
,
"ONNX"
,
0.0046
,
0.0077
);
}
...
...
modules/dnn/test/test_onnx_importer.cpp
浏览文件 @
d9bf522b
...
...
@@ -1855,6 +1855,11 @@ TEST_P(Test_ONNX_layers, Quantized_Constant)
testONNXModels
(
"quantized_constant"
,
npy
,
0.002
,
0.008
);
}
TEST_P
(
Test_ONNX_layers
,
OutputRegistration
)
{
testONNXModels
(
"output_registration"
,
npy
,
0
,
0
,
false
,
true
,
2
);
}
INSTANTIATE_TEST_CASE_P
(
/*nothing*/
,
Test_ONNX_layers
,
dnnBackendsAndTargets
());
class
Test_ONNX_nets
:
public
Test_ONNX_layers
...
...
modules/ts/src/ts_gtest.cpp
浏览文件 @
d9bf522b
...
...
@@ -8718,7 +8718,7 @@ static void StackLowerThanAddress(const void* ptr, bool* result) {
// Make sure AddressSanitizer does not tamper with the stack here.
GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
static
bool
StackGrowsDown
()
{
int
dummy
;
int
dummy
=
0
;
bool
result
;
StackLowerThanAddress
(
&
dummy
,
&
result
);
return
result
;
...
...
modules/video/src/tracking/tracker_dasiamrpn.cpp
浏览文件 @
d9bf522b
...
...
@@ -160,7 +160,7 @@ void TrackerDaSiamRPNImpl::trackerInit(Mat img)
dnn
::
blobFromImage
(
zCrop
,
blob
,
1.0
,
Size
(
trackState
.
exemplarSize
,
trackState
.
exemplarSize
),
Scalar
(),
trackState
.
swapRB
,
false
,
CV_32F
);
siamRPN
.
setInput
(
blob
);
Mat
out1
;
siamRPN
.
forward
(
out1
,
"63"
);
siamRPN
.
forward
(
out1
,
"
onnx_node_output_0!
63"
);
siamKernelCL1
.
setInput
(
out1
);
siamKernelR1
.
setInput
(
out1
);
...
...
@@ -169,8 +169,8 @@ void TrackerDaSiamRPNImpl::trackerInit(Mat img)
Mat
r1
=
siamKernelR1
.
forward
();
std
::
vector
<
int
>
r1_shape
=
{
20
,
256
,
4
,
4
},
cls1_shape
=
{
10
,
256
,
4
,
4
};
siamRPN
.
setParam
(
siamRPN
.
getLayerId
(
"65"
),
0
,
r1
.
reshape
(
0
,
r1_shape
));
siamRPN
.
setParam
(
siamRPN
.
getLayerId
(
"68"
),
0
,
cls1
.
reshape
(
0
,
cls1_shape
));
siamRPN
.
setParam
(
siamRPN
.
getLayerId
(
"
onnx_node_output_0!
65"
),
0
,
r1
.
reshape
(
0
,
r1_shape
));
siamRPN
.
setParam
(
siamRPN
.
getLayerId
(
"
onnx_node_output_0!
68"
),
0
,
cls1
.
reshape
(
0
,
cls1_shape
));
}
bool
TrackerDaSiamRPNImpl
::
update
(
InputArray
image
,
Rect
&
boundingBox
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录