}
};
-TEST_F(TestImageClassification, CPU_TFLITE_MobilenetV1)
+TEST_P(TestImageClassification, CPU_TFLITE_MobilenetV1)
{
engine_config_hosted_cpu_tflite_user_model(
engine_cfg, IC_TFLITE_WEIGHT_MOBILENET_V1_224_PATH,
- IC_LABEL_MOBILENET_V1_224_PATH);
+ IC_LABEL_MOBILENET_V1_224_PATH, _use_json_parser);
+
+ if (!_use_json_parser) {
+ const char *inputNodeName = "input";
+ const char *outputNodeName[] = { "MobilenetV1/Predictions/Reshape_1" };
+
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_MODEL_MEAN_VALUE, 127.5),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_MODEL_STD_VALUE, 127.5),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_CONFIDENCE_THRESHOLD, 0.0),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_WIDTH, 224),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_HEIGHT, 224),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_CHANNELS, 3),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_string_attribute(engine_cfg, MV_INFERENCE_INPUT_NODE_NAME,
+ inputNodeName), MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_array_string_attribute(engine_cfg, MV_INFERENCE_OUTPUT_NODE_NAMES,
+ outputNodeName, 1), MEDIA_VISION_ERROR_NONE);
+ }
+
inferenceBanana();
}
-TEST_F(TestImageClassification, CPU_TFLITE_MobilenetV2)
+TEST_P(TestImageClassification, CPU_TFLITE_MobilenetV2)
{
engine_config_hosted_cpu_tflite_user_model(
engine_cfg, IC_TFLITE_WEIGHT_MOBILENET_V2_224_PATH,
- IC_LABEL_MOBILENET_V1_224_PATH);
+ IC_LABEL_MOBILENET_V1_224_PATH, _use_json_parser);
+
+ if (!_use_json_parser) {
+ const char *inputNodeName = "input";
+ const char *outputNodeName[] = { "MobilenetV2/Predictions/Reshape_1" };
+
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_MODEL_MEAN_VALUE, 127.5),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_MODEL_STD_VALUE, 127.5),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_CONFIDENCE_THRESHOLD, 0.01),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_WIDTH, 224),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_HEIGHT, 224),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_CHANNELS, 3),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_string_attribute(engine_cfg, MV_INFERENCE_INPUT_NODE_NAME,
+ inputNodeName), MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_array_string_attribute(engine_cfg, MV_INFERENCE_OUTPUT_NODE_NAMES,
+ outputNodeName, 1), MEDIA_VISION_ERROR_NONE);
+ }
+
inferenceBanana();
}
-TEST_F(TestImageClassification, CPU_TFLITE_Densenet)
+TEST_P(TestImageClassification, CPU_TFLITE_Densenet)
{
engine_config_hosted_cpu_tflite_user_model(
engine_cfg, IC_TFLITE_WEIGHT_DENSENET_224_PATH,
- IC_LABEL_MOBILENET_V1_224_PATH);
+ IC_LABEL_MOBILENET_V1_224_PATH, _use_json_parser);
+
+ if (!_use_json_parser) {
+ const char *inputNodeName = "Placeholder";
+ const char *outputNodeName[] = { "softmax_tensor" };
+
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_MODEL_MEAN_VALUE, 127.5),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_MODEL_STD_VALUE, 255.0),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_CONFIDENCE_THRESHOLD, 0.0),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_WIDTH, 224),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_HEIGHT, 224),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_CHANNELS, 3),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_string_attribute(engine_cfg, MV_INFERENCE_INPUT_NODE_NAME,
+ inputNodeName), MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_array_string_attribute(engine_cfg, MV_INFERENCE_OUTPUT_NODE_NAMES,
+ outputNodeName, 1), MEDIA_VISION_ERROR_NONE);
+ }
+
inferenceBanana();
}
-TEST_F(TestImageClassification, CPU_TFLITE_Nasnet)
+TEST_P(TestImageClassification, CPU_TFLITE_Nasnet)
{
engine_config_hosted_cpu_tflite_user_model(engine_cfg,
IC_TFLITE_WEIGHT_NASNET_224_PATH,
- IC_LABEL_MOBILENET_V1_224_PATH);
+ IC_LABEL_MOBILENET_V1_224_PATH,
+ _use_json_parser);
+
+ if (!_use_json_parser) {
+ const char *inputNodeName = "input";
+ const char *outputNodeName[] = { "final_layer/predictions" };
+
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_MODEL_MEAN_VALUE, 127.5),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_MODEL_STD_VALUE, 127.5),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_CONFIDENCE_THRESHOLD, 0.0),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_WIDTH, 224),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_HEIGHT, 224),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_CHANNELS, 3),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_string_attribute(engine_cfg, MV_INFERENCE_INPUT_NODE_NAME,
+ inputNodeName), MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_array_string_attribute(engine_cfg, MV_INFERENCE_OUTPUT_NODE_NAMES,
+ outputNodeName, 1), MEDIA_VISION_ERROR_NONE);
+ }
+
inferenceBanana();
}
-TEST_F(TestImageClassification, CPU_TFLITE_MNasnet)
+TEST_P(TestImageClassification, CPU_TFLITE_MNasnet)
{
engine_config_hosted_cpu_tflite_user_model(
engine_cfg, IC_TFLITE_WEIGHT_MNASNET_224_PATH,
- IC_LABEL_MOBILENET_V1_224_PATH);
+ IC_LABEL_MOBILENET_V1_224_PATH,
+ _use_json_parser);
+
+ if (!_use_json_parser) {
+ const char *inputNodeName = "input";
+ const char *outputNodeName[] = { "output" };
+
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_MODEL_MEAN_VALUE, 127.5),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_MODEL_STD_VALUE, 57.5),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_CONFIDENCE_THRESHOLD, 0.0),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_WIDTH, 224),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_HEIGHT, 224),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_CHANNELS, 3),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_string_attribute(engine_cfg, MV_INFERENCE_INPUT_NODE_NAME,
+ inputNodeName), MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_array_string_attribute(engine_cfg, MV_INFERENCE_OUTPUT_NODE_NAMES,
+ outputNodeName, 1), MEDIA_VISION_ERROR_NONE);
+ }
+
inferenceBanana();
}
-TEST_F(TestImageClassification, CPU_TFLITE_Squeezenet)
+TEST_P(TestImageClassification, CPU_TFLITE_Squeezenet)
{
engine_config_hosted_cpu_tflite_user_model(
engine_cfg, IC_TFLITE_WEIGHT_SQUEEZENET_224_PATH,
- IC_LABEL_MOBILENET_V1_224_PATH);
+ IC_LABEL_MOBILENET_V1_224_PATH,
+ _use_json_parser);
+
+ if (!_use_json_parser) {
+ const char *inputNodeName = "Placeholder";
+ const char *outputNodeName[] = { "softmax_tensor" };
+
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_MODEL_MEAN_VALUE, 127.5),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_MODEL_STD_VALUE, 127.5),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_CONFIDENCE_THRESHOLD, 0.0),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_WIDTH, 224),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_HEIGHT, 224),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_CHANNELS, 3),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_string_attribute(engine_cfg, MV_INFERENCE_INPUT_NODE_NAME,
+ inputNodeName), MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_array_string_attribute(engine_cfg, MV_INFERENCE_OUTPUT_NODE_NAMES,
+ outputNodeName, 1), MEDIA_VISION_ERROR_NONE);
+ }
+
inferenceBanana();
}
-TEST_F(TestImageClassification, CPU_TFLITE_QUANT_MobilenetV1)
+TEST_P(TestImageClassification, CPU_TFLITE_QUANT_MobilenetV1)
{
engine_config_hosted_cpu_tflite_user_model(
engine_cfg, IC_TFLITE_WEIGHT_QUANT_MOBILENET_V1_224_PATH,
- IC_LABEL_MOBILENET_V1_224_PATH);
+ IC_LABEL_MOBILENET_V1_224_PATH,
+ _use_json_parser);
+
+ if (!_use_json_parser) {
+ const char *inputNodeName = "input";
+ const char *outputNodeName[] = { "MobilenetV1/Predictions/Reshape_1" };
+
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_DATA_TYPE, MV_INFERENCE_DATA_UINT8),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_MODEL_MEAN_VALUE, 0.0),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_MODEL_STD_VALUE, 1.0),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_double_attribute(engine_cfg, MV_INFERENCE_CONFIDENCE_THRESHOLD, 0.0),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_WIDTH, 224),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_HEIGHT, 224),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_int_attribute(engine_cfg, MV_INFERENCE_INPUT_TENSOR_CHANNELS, 3),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_string_attribute(engine_cfg, MV_INFERENCE_INPUT_NODE_NAME,
+ inputNodeName), MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_engine_config_set_array_string_attribute(engine_cfg, MV_INFERENCE_OUTPUT_NODE_NAMES,
+ outputNodeName, 1), MEDIA_VISION_ERROR_NONE);
+ }
+
inferenceBanana();
-}
\ No newline at end of file
+}
+
+INSTANTIATE_TEST_CASE_P(Prefix, TestImageClassification,
+ ::testing::Values(
+ ParamTypeOne(false),
+ ParamTypeOne(true)
+ )
+);
\ No newline at end of file