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
b584c230
Commit
b584c230
authored
Aug 02, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15158 from dkurt:fix_tf_ssd_configs
parents
ba934ff1
77d4e3e8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
20 additions
and
29 deletions
+20
-29
perf_net.cpp
modules/dnn/perf/perf_net.cpp
+0
-4
elementwise_layers.cpp
modules/dnn/src/layers/elementwise_layers.cpp
+1
-1
test_backends.cpp
modules/dnn/test/test_backends.cpp
+1
-9
test_caffe_importer.cpp
modules/dnn/test/test_caffe_importer.cpp
+4
-0
test_darknet_importer.cpp
modules/dnn/test/test_darknet_importer.cpp
+1
-1
test_layers.cpp
modules/dnn/test/test_layers.cpp
+6
-1
test_tf_importer.cpp
modules/dnn/test/test_tf_importer.cpp
+1
-11
tf_text_graph_ssd.py
samples/dnn/tf_text_graph_ssd.py
+6
-2
No files found.
modules/dnn/perf/perf_net.cpp
View file @
b584c230
...
...
@@ -142,8 +142,6 @@ PERF_TEST_P_(DNNTestNetwork, MobileNet_SSD_v1_TensorFlow)
{
if
(
backend
==
DNN_BACKEND_HALIDE
)
throw
SkipTestException
(
""
);
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
==
DNN_TARGET_MYRIAD
)
throw
SkipTestException
(
""
);
processNet
(
"dnn/ssd_mobilenet_v1_coco_2017_11_17.pb"
,
"ssd_mobilenet_v1_coco_2017_11_17.pbtxt"
,
""
,
Mat
(
cv
::
Size
(
300
,
300
),
CV_32FC3
));
}
...
...
@@ -152,8 +150,6 @@ PERF_TEST_P_(DNNTestNetwork, MobileNet_SSD_v2_TensorFlow)
{
if
(
backend
==
DNN_BACKEND_HALIDE
)
throw
SkipTestException
(
""
);
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
==
DNN_TARGET_MYRIAD
)
throw
SkipTestException
(
""
);
processNet
(
"dnn/ssd_mobilenet_v2_coco_2018_03_29.pb"
,
"ssd_mobilenet_v2_coco_2018_03_29.pbtxt"
,
""
,
Mat
(
cv
::
Size
(
300
,
300
),
CV_32FC3
));
}
...
...
modules/dnn/src/layers/elementwise_layers.cpp
View file @
b584c230
...
...
@@ -744,7 +744,7 @@ struct AbsValFunctor
#ifdef HAVE_INF_ENGINE
InferenceEngine
::
Builder
::
Layer
initInfEngineBuilderAPI
()
{
return
InferenceEngine
::
Builder
::
ReLULayer
(
""
).
setNegativeSlope
(
-
1
);
return
InferenceEngine
::
Builder
::
ReLULayer
(
""
).
setNegativeSlope
(
-
0.999999
f
);
}
#endif // HAVE_INF_ENGINE
...
...
modules/dnn/test/test_backends.cpp
View file @
b584c230
...
...
@@ -205,10 +205,6 @@ TEST_P(DNNTestNetwork, MobileNet_SSD_v1_TensorFlow)
applyTestTag
(
target
==
DNN_TARGET_CPU
?
""
:
CV_TEST_TAG_MEMORY_512MB
);
if
(
backend
==
DNN_BACKEND_HALIDE
)
applyTestTag
(
CV_TEST_TAG_DNN_SKIP_HALIDE
);
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2019020000)
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
==
DNN_TARGET_MYRIAD
)
applyTestTag
(
CV_TEST_TAG_DNN_SKIP_IE_MYRIAD
,
CV_TEST_TAG_DNN_SKIP_IE
,
CV_TEST_TAG_DNN_SKIP_IE_2019R2
);
#endif
Mat
sample
=
imread
(
findDataFile
(
"dnn/street.png"
));
Mat
inp
=
blobFromImage
(
sample
,
1.0
f
,
Size
(
300
,
300
),
Scalar
(),
false
);
...
...
@@ -248,10 +244,6 @@ TEST_P(DNNTestNetwork, MobileNet_SSD_v2_TensorFlow)
applyTestTag
(
target
==
DNN_TARGET_CPU
?
CV_TEST_TAG_MEMORY_512MB
:
CV_TEST_TAG_MEMORY_1GB
);
if
(
backend
==
DNN_BACKEND_HALIDE
)
applyTestTag
(
CV_TEST_TAG_DNN_SKIP_HALIDE
);
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2019020000)
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
==
DNN_TARGET_MYRIAD
)
applyTestTag
(
CV_TEST_TAG_DNN_SKIP_IE_MYRIAD
,
CV_TEST_TAG_DNN_SKIP_IE
,
CV_TEST_TAG_DNN_SKIP_IE_2019R2
);
#endif
Mat
sample
=
imread
(
findDataFile
(
"dnn/street.png"
));
Mat
inp
=
blobFromImage
(
sample
,
1.0
f
,
Size
(
300
,
300
),
Scalar
(),
false
);
...
...
@@ -395,7 +387,7 @@ TEST_P(DNNTestNetwork, DenseNet_121)
float
l1
=
0.0
,
lInf
=
0.0
;
if
(
target
==
DNN_TARGET_OPENCL_FP16
)
{
l1
=
9e-3
;
lInf
=
5
e-2
;
l1
=
2e-2
;
lInf
=
9
e-2
;
}
else
if
(
target
==
DNN_TARGET_MYRIAD
)
{
...
...
modules/dnn/test/test_caffe_importer.cpp
View file @
b584c230
...
...
@@ -496,7 +496,11 @@ TEST_P(Test_Caffe_nets, DenseNet_121)
float
l1
=
default_l1
,
lInf
=
default_lInf
;
if
(
target
==
DNN_TARGET_OPENCL_FP16
)
{
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2019020000)
l1
=
0.04
;
lInf
=
0.21
;
#else
l1
=
0.017
;
lInf
=
0.0795
;
#endif
}
else
if
(
target
==
DNN_TARGET_MYRIAD
)
{
...
...
modules/dnn/test/test_darknet_importer.cpp
View file @
b584c230
...
...
@@ -360,7 +360,7 @@ TEST_P(Test_Darknet_nets, YOLOv3)
1
,
2
,
0.989633
f
,
0.450719
f
,
0.463353
f
,
0.496305
f
,
0.522258
f
,
// a car
1
,
2
,
0.997412
f
,
0.647584
f
,
0.459939
f
,
0.821038
f
,
0.663947
f
);
// a car
double
scoreDiff
=
(
target
==
DNN_TARGET_OPENCL_FP16
||
target
==
DNN_TARGET_MYRIAD
)
?
0.00
47
:
8e-5
;
double
scoreDiff
=
(
target
==
DNN_TARGET_OPENCL_FP16
||
target
==
DNN_TARGET_MYRIAD
)
?
0.00
6
:
8e-5
;
double
iouDiff
=
(
target
==
DNN_TARGET_OPENCL_FP16
||
target
==
DNN_TARGET_MYRIAD
)
?
0.018
:
3e-4
;
std
::
string
config_file
=
"yolov3.cfg"
;
...
...
modules/dnn/test/test_layers.cpp
View file @
b584c230
...
...
@@ -233,9 +233,14 @@ TEST_P(Test_Caffe_layers, Dropout)
TEST_P
(
Test_Caffe_layers
,
Concat
)
{
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_GE(2019010000)
#if defined(INF_ENGINE_RELEASE)
#if INF_ENGINE_VER_MAJOR_GE(2019010000) && INF_ENGINE_VER_MAJOR_LT(2019020000)
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
==
DNN_TARGET_MYRIAD
)
applyTestTag
(
CV_TEST_TAG_DNN_SKIP_IE_MYRIAD
,
CV_TEST_TAG_DNN_SKIP_IE_2019R1
,
CV_TEST_TAG_DNN_SKIP_IE_2019R1_1
);
#elif INF_ENGINE_VER_MAJOR_EQ(2019020000)
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
==
DNN_TARGET_OPENCL
)
applyTestTag
(
CV_TEST_TAG_DNN_SKIP_IE_OPENCL
,
CV_TEST_TAG_DNN_SKIP_IE_2019R2
);
#endif
#endif
testLayerUsingCaffeModels
(
"layer_concat"
);
testLayerUsingCaffeModels
(
"layer_concat_optim"
,
true
,
false
);
...
...
modules/dnn/test/test_tf_importer.cpp
View file @
b584c230
...
...
@@ -436,11 +436,6 @@ TEST_P(Test_TensorFlow_nets, Inception_v2_SSD)
TEST_P
(
Test_TensorFlow_nets
,
MobileNet_v1_SSD
)
{
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2019020000)
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
==
DNN_TARGET_MYRIAD
)
applyTestTag
(
CV_TEST_TAG_DNN_SKIP_IE_MYRIAD
,
CV_TEST_TAG_DNN_SKIP_IE
,
CV_TEST_TAG_DNN_SKIP_IE_2019R2
);
#endif
checkBackend
();
std
::
string
proto
=
findDataFile
(
"dnn/ssd_mobilenet_v1_coco_2017_11_17.pbtxt"
);
std
::
string
model
=
findDataFile
(
"dnn/ssd_mobilenet_v1_coco_2017_11_17.pb"
,
false
);
...
...
@@ -456,7 +451,7 @@ TEST_P(Test_TensorFlow_nets, MobileNet_v1_SSD)
Mat
out
=
net
.
forward
();
Mat
ref
=
blobFromNPY
(
findDataFile
(
"dnn/tensorflow/ssd_mobilenet_v1_coco_2017_11_17.detection_out.npy"
));
float
scoreDiff
=
(
target
==
DNN_TARGET_OPENCL_FP16
||
target
==
DNN_TARGET_MYRIAD
)
?
7e-3
:
1.5e-5
;
float
scoreDiff
=
(
target
==
DNN_TARGET_OPENCL_FP16
||
target
==
DNN_TARGET_MYRIAD
)
?
0.011
:
1.5e-5
;
float
iouDiff
=
(
target
==
DNN_TARGET_OPENCL_FP16
||
target
==
DNN_TARGET_MYRIAD
)
?
0.012
:
1e-3
;
float
detectionConfThresh
=
(
target
==
DNN_TARGET_MYRIAD
)
?
0.35
:
0.3
;
...
...
@@ -515,11 +510,6 @@ TEST_P(Test_TensorFlow_nets, MobileNet_v1_SSD_PPN)
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
(
target
==
DNN_TARGET_OPENCL
||
target
==
DNN_TARGET_OPENCL_FP16
))
applyTestTag
(
target
==
DNN_TARGET_OPENCL
?
CV_TEST_TAG_DNN_SKIP_IE_OPENCL
:
CV_TEST_TAG_DNN_SKIP_IE_OPENCL_FP16
);
#endif
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2019020000)
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
==
DNN_TARGET_MYRIAD
)
applyTestTag
(
CV_TEST_TAG_DNN_SKIP_IE_MYRIAD
,
CV_TEST_TAG_DNN_SKIP_IE
,
CV_TEST_TAG_DNN_SKIP_IE_2019R2
);
#endif
checkBackend
();
std
::
string
proto
=
findDataFile
(
"dnn/ssd_mobilenet_v1_ppn_coco.pbtxt"
);
std
::
string
model
=
findDataFile
(
"dnn/ssd_mobilenet_v1_ppn_coco.pb"
,
false
);
...
...
samples/dnn/tf_text_graph_ssd.py
View file @
b584c230
...
...
@@ -312,12 +312,16 @@ def createSSDGraph(modelPath, configPath, outputPath):
addConcatNode
(
'PriorBox/concat'
,
priorBoxes
,
'concat/axis_flatten'
)
# Sigmoid for classes predictions and DetectionOutput layer
addReshape
(
'ClassPredictor/concat'
,
'ClassPredictor/concat3d'
,
[
0
,
-
1
,
num_classes
+
1
],
graph_def
)
sigmoid
=
NodeDef
()
sigmoid
.
name
=
'ClassPredictor/concat/sigmoid'
sigmoid
.
op
=
'Sigmoid'
sigmoid
.
input
.
append
(
'ClassPredictor/concat'
)
sigmoid
.
input
.
append
(
'ClassPredictor/concat
3d
'
)
graph_def
.
node
.
extend
([
sigmoid
])
addFlatten
(
sigmoid
.
name
,
sigmoid
.
name
+
'/Flatten'
,
graph_def
)
detectionOut
=
NodeDef
()
detectionOut
.
name
=
'detection_out'
detectionOut
.
op
=
'DetectionOutput'
...
...
@@ -326,7 +330,7 @@ def createSSDGraph(modelPath, configPath, outputPath):
detectionOut
.
input
.
append
(
'BoxEncodingPredictor/concat'
)
else
:
detectionOut
.
input
.
append
(
'BoxPredictor/concat'
)
detectionOut
.
input
.
append
(
sigmoid
.
name
)
detectionOut
.
input
.
append
(
sigmoid
.
name
+
'/Flatten'
)
detectionOut
.
input
.
append
(
'PriorBox/concat'
)
detectionOut
.
addAttr
(
'num_classes'
,
num_classes
+
1
)
...
...
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