Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
afaf5f94
Commit
afaf5f94
authored
Jun 05, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11695 from alalek:dnn_test_fix_sa_warnings
parents
31a1df0f
6816495b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
29 deletions
+10
-29
perf_net.cpp
modules/dnn/perf/perf_net.cpp
+2
-22
test_common.hpp
modules/dnn/test/test_common.hpp
+8
-7
No files found.
modules/dnn/perf/perf_net.cpp
View file @
afaf5f94
...
...
@@ -10,6 +10,8 @@
#include "opencv2/dnn/shape_utils.hpp"
#include "../test/test_common.hpp"
namespace
opencv_test
{
CV_ENUM
(
DNNBackend
,
DNN_BACKEND_DEFAULT
,
DNN_BACKEND_HALIDE
,
DNN_BACKEND_INFERENCE_ENGINE
)
...
...
@@ -29,28 +31,6 @@ public:
target
=
(
dnn
::
Target
)(
int
)
get
<
1
>
(
GetParam
());
}
static
bool
checkMyriadTarget
()
{
#ifndef HAVE_INF_ENGINE
return
false
;
#endif
cv
::
dnn
::
Net
net
;
cv
::
dnn
::
LayerParams
lp
;
net
.
addLayerToPrev
(
"testLayer"
,
"Identity"
,
lp
);
net
.
setPreferableBackend
(
cv
::
dnn
::
DNN_BACKEND_INFERENCE_ENGINE
);
net
.
setPreferableTarget
(
cv
::
dnn
::
DNN_TARGET_MYRIAD
);
net
.
setInput
(
cv
::
Mat
::
zeros
(
1
,
1
,
CV_32FC1
));
try
{
net
.
forward
();
}
catch
(...)
{
return
false
;
}
return
true
;
}
void
processNet
(
std
::
string
weights
,
std
::
string
proto
,
std
::
string
halide_scheduler
,
const
Mat
&
input
,
const
std
::
string
&
outputLayer
=
""
)
{
...
...
modules/dnn/test/test_common.hpp
View file @
afaf5f94
...
...
@@ -42,12 +42,12 @@
#ifndef __OPENCV_TEST_COMMON_HPP__
#define __OPENCV_TEST_COMMON_HPP__
inline
const
std
::
string
&
getOpenCVExtraDir
()
static
inline
const
std
::
string
&
getOpenCVExtraDir
()
{
return
cvtest
::
TS
::
ptr
()
->
get_data_path
();
}
inline
void
normAssert
(
cv
::
InputArray
ref
,
cv
::
InputArray
test
,
const
char
*
comment
=
""
,
static
inline
void
normAssert
(
cv
::
InputArray
ref
,
cv
::
InputArray
test
,
const
char
*
comment
=
""
,
double
l1
=
0.00001
,
double
lInf
=
0.0001
)
{
double
normL1
=
cvtest
::
norm
(
ref
,
test
,
cv
::
NORM_L1
)
/
ref
.
getMat
().
total
();
...
...
@@ -74,7 +74,7 @@ static std::vector<cv::Rect2d> matToBoxes(const cv::Mat& m)
return
boxes
;
}
inline
void
normAssertDetections
(
const
std
::
vector
<
int
>&
refClassIds
,
static
inline
void
normAssertDetections
(
const
std
::
vector
<
int
>&
refClassIds
,
const
std
::
vector
<
float
>&
refScores
,
const
std
::
vector
<
cv
::
Rect2d
>&
refBoxes
,
const
std
::
vector
<
int
>&
testClassIds
,
...
...
@@ -128,7 +128,7 @@ inline void normAssertDetections(const std::vector<int>& refClassIds,
// For SSD-based object detection networks which produce output of shape 1x1xNx7
// where N is a number of detections and an every detection is represented by
// a vector [batchId, classId, confidence, left, top, right, bottom].
inline
void
normAssertDetections
(
cv
::
Mat
ref
,
cv
::
Mat
out
,
const
char
*
comment
=
""
,
static
inline
void
normAssertDetections
(
cv
::
Mat
ref
,
cv
::
Mat
out
,
const
char
*
comment
=
""
,
double
confThreshold
=
0.0
,
double
scores_diff
=
1e-5
,
double
boxes_iou_diff
=
1e-4
)
{
...
...
@@ -147,11 +147,11 @@ inline void normAssertDetections(cv::Mat ref, cv::Mat out, const char *comment =
testBoxes
,
comment
,
confThreshold
,
scores_diff
,
boxes_iou_diff
);
}
inline
bool
checkMyriadTarget
()
static
inline
bool
checkMyriadTarget
()
{
#ifndef HAVE_INF_ENGINE
return
false
;
#e
ndif
#e
lse
cv
::
dnn
::
Net
net
;
cv
::
dnn
::
LayerParams
lp
;
net
.
addLayerToPrev
(
"testLayer"
,
"Identity"
,
lp
);
...
...
@@ -167,9 +167,10 @@ inline bool checkMyriadTarget()
return
false
;
}
return
true
;
#endif
}
inline
bool
readFileInMemory
(
const
std
::
string
&
filename
,
std
::
string
&
content
)
static
inline
bool
readFileInMemory
(
const
std
::
string
&
filename
,
std
::
string
&
content
)
{
std
::
ios
::
openmode
mode
=
std
::
ios
::
in
|
std
::
ios
::
binary
;
std
::
ifstream
ifs
(
filename
.
c_str
(),
mode
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment