@@ -103,11 +103,15 @@ static const std::map<std::string, OpenVINOModelTestCaseInfo>& getOpenVINOTestMo
103
103
#if INF_ENGINE_RELEASE >= 2020010000
104
104
// Downloaded using these parameters for Open Model Zoo downloader (2020.1):
105
105
// ./downloader.py -o ${OPENCV_DNN_TEST_DATA_PATH}/omz_intel_models --cache_dir ${OPENCV_DNN_TEST_DATA_PATH}/.omz_cache/ \
106
- // --name person-detection-retail-0013
106
+ // --name person-detection-retail-0013,age-gender-recognition-retail-0013
107
107
{ " person-detection-retail-0013" , { // IRv10
108
108
" intel/person-detection-retail-0013/FP32/person-detection-retail-0013" ,
109
109
" intel/person-detection-retail-0013/FP16/person-detection-retail-0013"
110
110
}},
111
+ { " age-gender-recognition-retail-0013" , {
112
+ " intel/age-gender-recognition-retail-0013/FP16/age-gender-recognition-retail-0013" ,
113
+ " intel/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013"
114
+ }},
111
115
#endif
112
116
};
113
117
@@ -123,6 +127,21 @@ static const std::vector<std::string> getOpenVINOTestModelsList()
123
127
return result;
124
128
}
125
129
130
+ inline static std::string getOpenVINOModel (const std::string &modelName, bool isFP16)
131
+ {
132
+ const std::map<std::string, OpenVINOModelTestCaseInfo>& models = getOpenVINOTestModels ();
133
+ const auto it = models.find (modelName);
134
+ if (it != models.end ())
135
+ {
136
+ OpenVINOModelTestCaseInfo modelInfo = it->second ;
137
+ if (isFP16 && modelInfo.modelPathFP16 )
138
+ return std::string (modelInfo.modelPathFP16 );
139
+ else if (!isFP16 && modelInfo.modelPathFP32 )
140
+ return std::string (modelInfo.modelPathFP32 );
141
+ }
142
+ return std::string ();
143
+ }
144
+
126
145
static inline void genData (const InferenceEngine::TensorDesc& desc, Mat& m, Blob::Ptr& dataPtr)
127
146
{
128
147
const std::vector<size_t >& dims = desc.getDims ();
@@ -310,11 +329,8 @@ TEST_P(DNNTestOpenVINO, models)
310
329
311
330
bool isFP16 = (targetId == DNN_TARGET_OPENCL_FP16 || targetId == DNN_TARGET_MYRIAD);
312
331
313
- const std::map<std::string, OpenVINOModelTestCaseInfo>& models = getOpenVINOTestModels ();
314
- const auto it = models.find (modelName);
315
- ASSERT_TRUE (it != models.end ()) << modelName;
316
- OpenVINOModelTestCaseInfo modelInfo = it->second ;
317
- std::string modelPath = isFP16 ? modelInfo.modelPathFP16 : modelInfo.modelPathFP32 ;
332
+ const std::string modelPath = getOpenVINOModel (modelName, isFP16);
333
+ ASSERT_FALSE (modelPath.empty ()) << modelName;
318
334
319
335
std::string xmlPath = findDataFile (modelPath + " .xml" , false );
320
336
std::string binPath = findDataFile (modelPath + " .bin" , false );
@@ -358,10 +374,9 @@ TEST_P(DNNTestHighLevelAPI, predict)
358
374
359
375
Target target = (dnn::Target)(int )GetParam ();
360
376
bool isFP16 = (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD);
361
-
362
- OpenVINOModelTestCaseInfo modelInfo = getOpenVINOTestModels ().find (" age-gender-recognition-retail-0013" )->second ;
363
-
364
- std::string modelPath = isFP16 ? modelInfo.modelPathFP16 : modelInfo.modelPathFP32 ;
377
+ const std::string modelName = " age-gender-recognition-retail-0013" ;
378
+ const std::string modelPath = getOpenVINOModel (modelName, isFP16);
379
+ ASSERT_FALSE (modelPath.empty ()) << modelName;
365
380
366
381
std::string xmlPath = findDataFile (modelPath + " .xml" );
367
382
std::string binPath = findDataFile (modelPath + " .bin" );
0 commit comments