code refactoring to testsuites for machine learning 60/270760/2
authorInki Dae <inki.dae@samsung.com>
Tue, 8 Feb 2022 10:24:50 +0000 (19:24 +0900)
committerInki Dae <inki.dae@samsung.com>
Wed, 9 Feb 2022 08:04:14 +0000 (17:04 +0900)
[Version] : 0.15.0-0
[Issue type] : new feature

Did code refactoring to test suites for machine learning by
dropping code duplication and providing user given target device type.

Change-Id: I7e9b8df902af9c45d6d878b28a4e77e127e16982
Signed-off-by: Inki Dae <inki.dae@samsung.com>
packaging/capi-media-vision.spec
test/testsuites/machine_learning/inference/test_face_detection.cpp
test/testsuites/machine_learning/inference/test_face_landmark_detection.cpp
test/testsuites/machine_learning/inference/test_image_classification.cpp
test/testsuites/machine_learning/inference/test_inference_helper.cpp
test/testsuites/machine_learning/inference/test_inference_helper.hpp
test/testsuites/machine_learning/inference/test_object_detection.cpp
test/testsuites/machine_learning/inference/test_pose_landmark_detection.cpp

index a730803..d232162 100644 (file)
@@ -1,6 +1,6 @@
 Name:        capi-media-vision
 Summary:     Media Vision library for Tizen Native API
-Version:     0.14.0
+Version:     0.15.0
 Release:     0
 Group:       Multimedia/Framework
 License:     Apache-2.0 and BSD-3-Clause
index 59a357f..4e405e7 100644 (file)
@@ -20,15 +20,13 @@ void _face_detected_cb(mv_source_h source, const int number_of_faces,
        EXPECT_GT(number_of_faces, 0);
 }
 
-class TestFaceDetection : public TestInference
+class TestFaceDetectionTflite : public TestInference
 {
 public:
        void inferenceFace()
        {
-               ASSERT_EQ(mv_inference_configure(infer, engine_cfg),
-                                 MEDIA_VISION_ERROR_NONE);
+               TestInference::ConfigureInference();
 
-               ASSERT_EQ(mv_inference_prepare(infer), MEDIA_VISION_ERROR_NONE);
                ASSERT_EQ(MediaVision::Common::ImageHelper::loadImageToSource(
                                                  IMG_FACE, mv_source),
                                  MEDIA_VISION_ERROR_NONE);
@@ -38,10 +36,10 @@ public:
        }
 };
 
-TEST_P(TestFaceDetection, CPU_TFLITE_MobilenetV1_SSD)
+TEST_P(TestFaceDetectionTflite, MobilenetV1_SSD)
 {
-       engine_config_hosted_model_config(engine_cfg,
-                                                                       FD_TFLITE_WEIGHT_MOBILENET_V1_SSD_300_PATH, _use_json_parser);
+       engine_config_hosted_tflite_model(engine_cfg, FD_TFLITE_WEIGHT_MOBILENET_V1_SSD_300_PATH,
+                                                                         NULL, _use_json_parser, _target_device_type);
        if (!_use_json_parser) {
                const char *inputNodeName = "normalized_input_image_tensor";
                const char *outputNodeName[] = { "TFLite_Detection_PostProcess",
@@ -71,9 +69,9 @@ TEST_P(TestFaceDetection, CPU_TFLITE_MobilenetV1_SSD)
        inferenceFace();
 }
 
-INSTANTIATE_TEST_CASE_P(Prefix, TestFaceDetection,
+INSTANTIATE_TEST_CASE_P(Prefix, TestFaceDetectionTflite,
                                                ::testing::Values(
-                                                       ParamTypeOne(false),
-                                                       ParamTypeOne(true)
+                                                       ParamTypes(false, MV_INFERENCE_TARGET_DEVICE_CPU),
+                                                       ParamTypes(true, MV_INFERENCE_TARGET_DEVICE_CPU)
                                                )
 );
\ No newline at end of file
index e186c6f..f528619 100644 (file)
@@ -19,14 +19,13 @@ void _facial_landmark_detected_cb(mv_source_h source,
        EXPECT_GT(number_of_landmarks, 0);
 }
 
-class TestFaceLandmarkDetection : public TestInference
+class TestFaceLandmarkDetectionOpenCV : public TestInference
 {
 public:
        void inferenceFaceLandmark()
        {
-               ASSERT_EQ(mv_inference_configure(infer, engine_cfg),
-                                 MEDIA_VISION_ERROR_NONE);
-               ASSERT_EQ(mv_inference_prepare(infer), MEDIA_VISION_ERROR_NONE);
+               TestInference::ConfigureInference();
+
                ASSERT_EQ(MediaVision::Common::ImageHelper::loadImageToSource(
                                                  IMG_FACE_LANDMARK, mv_source),
                                  MEDIA_VISION_ERROR_NONE);
@@ -37,7 +36,7 @@ public:
        }
 };
 
-TEST_P(TestFaceLandmarkDetection, CPU_OPENCV_CAFFE_CNNCASCADE)
+TEST_P(TestFaceLandmarkDetectionOpenCV, CAFFE_CNNCASCADE)
 {
        const char *inputNodeName = "data";
        const char *outputNodeName[] = { "Sigmoid_fc2" };
@@ -87,9 +86,9 @@ TEST_P(TestFaceLandmarkDetection, CPU_OPENCV_CAFFE_CNNCASCADE)
        inferenceFaceLandmark();
 }
 
-INSTANTIATE_TEST_CASE_P(Prefix, TestFaceLandmarkDetection,
+INSTANTIATE_TEST_CASE_P(Prefix, TestFaceLandmarkDetectionOpenCV,
                                                ::testing::Values(
-                                                       ParamTypeOne(false),
-                                                       ParamTypeOne(true)
+                                                       ParamTypes(false, MV_INFERENCE_TARGET_DEVICE_CPU),
+                                                       ParamTypes(true, MV_INFERENCE_TARGET_DEVICE_CPU)
                                                )
 );
\ No newline at end of file
index 103f6df..f0ebba3 100644 (file)
@@ -53,14 +53,28 @@ void _image_classified_cb(mv_source_h source, const int number_of_classes,
        EXPECT_TRUE(answer_found);
 }
 
-class TestImageClassification : public TestInference
+class TestImageClassificationTflite : public TestInference
 {
 public:
        void inferenceBanana()
        {
-               ASSERT_EQ(mv_inference_configure(infer, engine_cfg),
+               TestInference::ConfigureInference();
+
+               ASSERT_EQ(MediaVision::Common::ImageHelper::loadImageToSource(IMG_BANANA, mv_source),
+                                                                                                                                         MEDIA_VISION_ERROR_NONE);
+               ASSERT_EQ(mv_inference_image_classify(mv_source, infer, NULL,
+                                                                                         _image_classified_cb, NULL),
                                  MEDIA_VISION_ERROR_NONE);
-               ASSERT_EQ(mv_inference_prepare(infer), MEDIA_VISION_ERROR_NONE);
+       }
+};
+
+class TestImageClassificationSnpe : public TestInference
+{
+public:
+       void inferenceBanana()
+       {
+               TestInference::ConfigureInference();
+
                ASSERT_EQ(MediaVision::Common::ImageHelper::loadImageToSource(
                                                  IMG_BANANA, mv_source),
                                  MEDIA_VISION_ERROR_NONE);
@@ -70,11 +84,11 @@ public:
        }
 };
 
-TEST_P(TestImageClassification, CPU_TFLITE_MobilenetV1)
+TEST_P(TestImageClassificationTflite, MobilenetV1)
 {
-       engine_config_hosted_cpu_tflite_user_model(
-                       engine_cfg, IC_TFLITE_WEIGHT_MOBILENET_V1_224_PATH,
-                       IC_LABEL_MOBILENET_V1_224_PATH, _use_json_parser);
+       engine_config_hosted_tflite_model(engine_cfg, IC_TFLITE_WEIGHT_MOBILENET_V1_224_PATH,
+                                                                         IC_LABEL_MOBILENET_V1_224_PATH, _use_json_parser,
+                                                                         _target_device_type);
 
        if (!_use_json_parser) {
                const char *inputNodeName = "input";
@@ -101,11 +115,11 @@ TEST_P(TestImageClassification, CPU_TFLITE_MobilenetV1)
        inferenceBanana();
 }
 
-TEST_P(TestImageClassification, CPU_TFLITE_MobilenetV2)
+TEST_P(TestImageClassificationTflite, MobilenetV2)
 {
-       engine_config_hosted_cpu_tflite_user_model(
-                       engine_cfg, IC_TFLITE_WEIGHT_MOBILENET_V2_224_PATH,
-                       IC_LABEL_MOBILENET_V1_224_PATH, _use_json_parser);
+       engine_config_hosted_tflite_model(engine_cfg, IC_TFLITE_WEIGHT_MOBILENET_V2_224_PATH,
+                                                                         IC_LABEL_MOBILENET_V1_224_PATH, _use_json_parser,
+                                                                         _target_device_type);
 
        if (!_use_json_parser) {
                const char *inputNodeName = "input";
@@ -132,11 +146,11 @@ TEST_P(TestImageClassification, CPU_TFLITE_MobilenetV2)
        inferenceBanana();
 }
 
-TEST_P(TestImageClassification, CPU_TFLITE_Densenet)
+TEST_P(TestImageClassificationTflite, Densenet)
 {
-       engine_config_hosted_cpu_tflite_user_model(
-                       engine_cfg, IC_TFLITE_WEIGHT_DENSENET_224_PATH,
-                       IC_LABEL_MOBILENET_V1_224_PATH, _use_json_parser);
+       engine_config_hosted_tflite_model(engine_cfg, IC_TFLITE_WEIGHT_DENSENET_224_PATH,
+                                                                         IC_LABEL_MOBILENET_V1_224_PATH, _use_json_parser,
+                                                                         _target_device_type);
 
        if (!_use_json_parser) {
                const char *inputNodeName = "Placeholder";
@@ -163,12 +177,11 @@ TEST_P(TestImageClassification, CPU_TFLITE_Densenet)
        inferenceBanana();
 }
 
-TEST_P(TestImageClassification, CPU_TFLITE_Nasnet)
+TEST_P(TestImageClassificationTflite, Nasnet)
 {
-       engine_config_hosted_cpu_tflite_user_model(engine_cfg,
-                                                                                          IC_TFLITE_WEIGHT_NASNET_224_PATH,
-                                                                                          IC_LABEL_MOBILENET_V1_224_PATH,
-                                                                                          _use_json_parser);
+       engine_config_hosted_tflite_model(engine_cfg, IC_TFLITE_WEIGHT_NASNET_224_PATH,
+                                                                         IC_LABEL_MOBILENET_V1_224_PATH, _use_json_parser,
+                                                                         _target_device_type);
 
        if (!_use_json_parser) {
                const char *inputNodeName = "input";
@@ -195,12 +208,11 @@ TEST_P(TestImageClassification, CPU_TFLITE_Nasnet)
        inferenceBanana();
 }
 
-TEST_P(TestImageClassification, CPU_TFLITE_MNasnet)
+TEST_P(TestImageClassificationTflite, MNasnet)
 {
-       engine_config_hosted_cpu_tflite_user_model(
-                       engine_cfg, IC_TFLITE_WEIGHT_MNASNET_224_PATH,
-                       IC_LABEL_MOBILENET_V1_224_PATH,
-                       _use_json_parser);
+       engine_config_hosted_tflite_model(engine_cfg, IC_TFLITE_WEIGHT_MNASNET_224_PATH,
+                                                                         IC_LABEL_MOBILENET_V1_224_PATH, _use_json_parser,
+                                                                         _target_device_type);
 
        if (!_use_json_parser) {
                const char *inputNodeName = "input";
@@ -227,12 +239,11 @@ TEST_P(TestImageClassification, CPU_TFLITE_MNasnet)
        inferenceBanana();
 }
 
-TEST_P(TestImageClassification, CPU_TFLITE_Squeezenet)
+TEST_P(TestImageClassificationTflite, Squeezenet)
 {
-       engine_config_hosted_cpu_tflite_user_model(
-                       engine_cfg, IC_TFLITE_WEIGHT_SQUEEZENET_224_PATH,
-                       IC_LABEL_MOBILENET_V1_224_PATH,
-                       _use_json_parser);
+       engine_config_hosted_tflite_model(engine_cfg, IC_TFLITE_WEIGHT_SQUEEZENET_224_PATH,
+                                                                         IC_LABEL_MOBILENET_V1_224_PATH, _use_json_parser,
+                                                                         _target_device_type);
 
        if (!_use_json_parser) {
                const char *inputNodeName = "Placeholder";
@@ -259,12 +270,11 @@ TEST_P(TestImageClassification, CPU_TFLITE_Squeezenet)
        inferenceBanana();
 }
 
-TEST_P(TestImageClassification, CPU_TFLITE_QUANT_MobilenetV1)
+TEST_P(TestImageClassificationTflite, 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,
-                       _use_json_parser);
+       engine_config_hosted_tflite_model(engine_cfg, IC_TFLITE_WEIGHT_QUANT_MOBILENET_V1_224_PATH,
+                                                                         IC_LABEL_MOBILENET_V1_224_PATH, _use_json_parser,
+                                                                         _target_device_type);
 
        if (!_use_json_parser) {
                const char *inputNodeName = "input";
@@ -293,12 +303,11 @@ TEST_P(TestImageClassification, CPU_TFLITE_QUANT_MobilenetV1)
        inferenceBanana();
 }
 
-TEST_P(TestImageClassification, SNPE_InceptionV3_Quantized)
+TEST_P(TestImageClassificationSnpe, InceptionV3_Quantized)
 {
-       engine_config_hosted_cpu_snpe_user_model(
-                       engine_cfg, IC_SNPE_WEIGHT_QUANT_INCEPTION_V3_299_PATH,
-                       IC_LABEL_INCEPTION_V3_299_PATH,
-                       _use_json_parser);
+       engine_config_hosted_snpe_model(engine_cfg, IC_SNPE_WEIGHT_QUANT_INCEPTION_V3_299_PATH,
+                                                                       IC_LABEL_INCEPTION_V3_299_PATH, _use_json_parser,
+                                                                       _target_device_type);
 
        if (!_use_json_parser) {
                const char *inputNodeName = "input";
@@ -327,9 +336,20 @@ TEST_P(TestImageClassification, SNPE_InceptionV3_Quantized)
        inferenceBanana();
 }
 
-INSTANTIATE_TEST_CASE_P(Prefix, TestImageClassification,
+INSTANTIATE_TEST_CASE_P(Prefix, TestImageClassificationTflite,
+                                               ::testing::Values(
+                                                       ParamTypes(false, MV_INFERENCE_TARGET_DEVICE_CPU),
+                                                       ParamTypes(true, MV_INFERENCE_TARGET_DEVICE_CPU)
+                                               )
+);
+
+INSTANTIATE_TEST_CASE_P(Prefix, TestImageClassificationSnpe,
                                                ::testing::Values(
-                                                       ParamTypeOne(false),
-                                                       ParamTypeOne(true)
+                                                       ParamTypes(false, MV_INFERENCE_TARGET_DEVICE_CPU),
+                                                       ParamTypes(false, MV_INFERENCE_TARGET_DEVICE_GPU),
+                                                       ParamTypes(false, MV_INFERENCE_TARGET_DEVICE_CUSTOM),
+                                                       ParamTypes(true, MV_INFERENCE_TARGET_DEVICE_CPU),
+                                                       ParamTypes(true, MV_INFERENCE_TARGET_DEVICE_GPU),
+                                                       ParamTypes(true, MV_INFERENCE_TARGET_DEVICE_CUSTOM)
                                                )
 );
\ No newline at end of file
index c041f48..7c476cc 100644 (file)
@@ -15,12 +15,18 @@ TestInference::~TestInference()
        EXPECT_EQ(mv_destroy_engine_config(engine_cfg), MEDIA_VISION_ERROR_NONE);
 }
 
+void TestInference::ConfigureInference()
+{
+       ASSERT_EQ(mv_inference_configure(infer, engine_cfg),
+                               MEDIA_VISION_ERROR_NONE);
+       ASSERT_EQ(mv_inference_prepare(infer), MEDIA_VISION_ERROR_NONE);
+}
+
 void engine_config_hosted_model_config(mv_engine_config_h handle,
-                                                                        const char *tf_weight,
-                                                                        const bool use_json_parser)
+                                                                          const char *tf_weight,
+                                                                          const bool use_json_parser)
 {
-       EXPECT_EQ(mv_engine_config_set_string_attribute(
-                                         handle, MV_INFERENCE_MODEL_WEIGHT_FILE_PATH, tf_weight),
+       EXPECT_EQ(mv_engine_config_set_string_attribute(handle, MV_INFERENCE_MODEL_WEIGHT_FILE_PATH, tf_weight),
                          MEDIA_VISION_ERROR_NONE);
 
        if (use_json_parser) {
@@ -34,10 +40,11 @@ void engine_config_hosted_model_config(mv_engine_config_h handle,
        }
 }
 
-void engine_config_hosted_cpu_tflite_user_model(mv_engine_config_h handle,
-                                                                                               const char *tf_weight,
-                                                                                               const char *user_file,
-                                                                                               const bool use_json_parser)
+void engine_config_hosted_tflite_model(mv_engine_config_h handle,
+                                                                          const char *tf_weight,
+                                                                          const char *user_file,
+                                                                          const bool use_json_parser,
+                                                                          const mv_inference_target_device_e target_device_type)
 {
        engine_config_hosted_model_config(handle, tf_weight, use_json_parser);
 
@@ -47,18 +54,20 @@ void engine_config_hosted_cpu_tflite_user_model(mv_engine_config_h handle,
                          MEDIA_VISION_ERROR_NONE);
        EXPECT_EQ(mv_engine_config_set_int_attribute(handle,
                                                                                                 MV_INFERENCE_TARGET_DEVICE_TYPE,
-                                                                                                MV_INFERENCE_TARGET_DEVICE_CPU),
+                                                                                                target_device_type),
                          MEDIA_VISION_ERROR_NONE);
 
-       EXPECT_EQ(mv_engine_config_set_string_attribute(
-                                         handle, MV_INFERENCE_MODEL_USER_FILE_PATH, user_file),
-                         MEDIA_VISION_ERROR_NONE);
+       if (user_file) {
+               EXPECT_EQ(mv_engine_config_set_string_attribute(handle, MV_INFERENCE_MODEL_USER_FILE_PATH, user_file),
+                                 MEDIA_VISION_ERROR_NONE);
+       }
 }
 
-void engine_config_hosted_cpu_snpe_user_model(mv_engine_config_h handle,
-                                                                                               const char *tf_weight,
-                                                                                               const char *user_file,
-                                                                                               const bool use_json_parser)
+void engine_config_hosted_snpe_model(mv_engine_config_h handle,
+                                                                        const char *tf_weight,
+                                                                        const char *user_file,
+                                                                        const bool use_json_parser,
+                                                                        const mv_inference_target_device_e target_device_type)
 {
        engine_config_hosted_model_config(handle, tf_weight, use_json_parser);
 
@@ -68,10 +77,10 @@ void engine_config_hosted_cpu_snpe_user_model(mv_engine_config_h handle,
                          MEDIA_VISION_ERROR_NONE);
        EXPECT_EQ(mv_engine_config_set_int_attribute(handle,
                                                                                                 MV_INFERENCE_TARGET_DEVICE_TYPE,
-                                                                                                MV_INFERENCE_TARGET_DEVICE_CPU),
+                                                                                                target_device_type),
                          MEDIA_VISION_ERROR_NONE);
 
        EXPECT_EQ(mv_engine_config_set_string_attribute(
                                          handle, MV_INFERENCE_MODEL_USER_FILE_PATH, user_file),
                          MEDIA_VISION_ERROR_NONE);
-}
+}
\ No newline at end of file
index 3023d81..26c3695 100644 (file)
@@ -3,17 +3,20 @@
 
 #include <mv_inference.h>
 
-typedef std::tuple<int> ParamTypeOne;
+typedef std::tuple<bool, mv_inference_target_device_e> ParamTypes;
 
-class TestInference : public ::testing::TestWithParam<ParamTypeOne>
+class TestInference : public ::testing::TestWithParam<ParamTypes>
 {
 protected:
        void SetUp() final
        {
-               std::tie(_use_json_parser) = GetParam();
+               std::tie(_use_json_parser, _target_device_type) = GetParam();
        }
 
+       void ConfigureInference();
+
        bool _use_json_parser;
+       mv_inference_target_device_e _target_device_type;
 
 public:
        TestInference();
@@ -24,17 +27,19 @@ public:
 };
 
 void engine_config_hosted_model_config(mv_engine_config_h handle,
-                                                                        const char *tf_weight,
-                                                                        const bool use_json_parser);
+                                                                          const char *tf_weight,
+                                                                          const bool use_json_parser);
 
-void engine_config_hosted_cpu_tflite_user_model(mv_engine_config_h handle,
-                                                                                               const char *tf_weight,
-                                                                                               const char *user_file,
-                                                                                               const bool use_json_parser);
+void engine_config_hosted_tflite_model(mv_engine_config_h handle,
+                                                                          const char *tf_weight,
+                                                                          const char *user_file,
+                                                                          const bool use_json_parser,
+                                                                          const mv_inference_target_device_e target_device_type);
 
-void engine_config_hosted_cpu_snpe_user_model(mv_engine_config_h handle,
-                                                                                               const char *tf_weight,
-                                                                                               const char *user_file,
-                                                                                               const bool use_json_parser);
+void engine_config_hosted_snpe_model(mv_engine_config_h handle,
+                                                                        const char *tf_weight,
+                                                                        const char *user_file,
+                                                                        const bool use_json_parser,
+                                                                        const mv_inference_target_device_e target_device_type);
 
 #endif //__TEST_INFERENCE_HELPER_HPP__
index b849c20..d1ace92 100644 (file)
@@ -29,14 +29,13 @@ void _object_detected_cb(mv_source_h source, const int number_of_objects,
        EXPECT_TRUE(answer_found);
 }
 
-class TestObjectDetection : public TestInference
+class TestObjectDetectionTflite : public TestInference
 {
 public:
        void inferenceDog()
        {
-               ASSERT_EQ(mv_inference_configure(infer, engine_cfg),
-                                 MEDIA_VISION_ERROR_NONE);
-               ASSERT_EQ(mv_inference_prepare(infer), MEDIA_VISION_ERROR_NONE);
+               TestInference::ConfigureInference();
+
                ASSERT_EQ(MediaVision::Common::ImageHelper::loadImageToSource(
                                                  IMG_DOG, mv_source),
                                  MEDIA_VISION_ERROR_NONE);
@@ -46,12 +45,11 @@ public:
        }
 };
 
-TEST_P(TestObjectDetection, CPU_TFLITE_MobilenetV1_SSD)
+TEST_P(TestObjectDetectionTflite, MobilenetV1_SSD)
 {
-       engine_config_hosted_cpu_tflite_user_model(
-                       engine_cfg, OD_TFLITE_WEIGHT_MOBILENET_V1_SSD_300_PATH,
-                       OD_LABEL_MOBILENET_V1_SSD_300_PATH,
-                       _use_json_parser);
+       engine_config_hosted_tflite_model(engine_cfg, OD_TFLITE_WEIGHT_MOBILENET_V1_SSD_300_PATH,
+                                                                         OD_LABEL_MOBILENET_V1_SSD_300_PATH, _use_json_parser,
+                                                                         _target_device_type);
 
        if (!_use_json_parser) {
                const char *inputNodeName = "normalized_input_image_tensor";
@@ -82,9 +80,9 @@ TEST_P(TestObjectDetection, CPU_TFLITE_MobilenetV1_SSD)
        inferenceDog();
 }
 
-INSTANTIATE_TEST_CASE_P(Prefix, TestObjectDetection,
+INSTANTIATE_TEST_CASE_P(Prefix, TestObjectDetectionTflite,
                                                ::testing::Values(
-                                                       ParamTypeOne(false),
-                                                       ParamTypeOne(true)
+                                                       ParamTypes(false, MV_INFERENCE_TARGET_DEVICE_CPU),
+                                                       ParamTypes(true, MV_INFERENCE_TARGET_DEVICE_CPU)
                                                )
 );
\ No newline at end of file
index 623903a..88f9918 100644 (file)
@@ -19,14 +19,13 @@ void _pose_landmark_detected_cb(mv_source_h source,
        ASSERT_EQ(cb_number_of_poses, 1);
 }
 
-class TestPoseLandmarkDetection : public TestInference
+class TestPoseLandmarkDetectionTflite : public TestInference
 {
 public:
        void inferencePoseLandmark()
        {
-               ASSERT_EQ(mv_inference_configure(infer, engine_cfg),
-                                 MEDIA_VISION_ERROR_NONE);
-               ASSERT_EQ(mv_inference_prepare(infer), MEDIA_VISION_ERROR_NONE);
+               TestInference::ConfigureInference();
+
                ASSERT_EQ(MediaVision::Common::ImageHelper::loadImageToSource(
                                                  IMG_POSE_LANDMARK, mv_source),
                                  MEDIA_VISION_ERROR_NONE);
@@ -37,10 +36,10 @@ public:
        }
 };
 
-TEST_P(TestPoseLandmarkDetection, CPU_TFLITE_MobilenetV1)
+TEST_P(TestPoseLandmarkDetectionTflite, MobilenetV1)
 {
-       engine_config_hosted_model_config(
-                       engine_cfg, PLD_TFLITE_WEIGHT_MOBILENET_V1_POSENET_257_PATH, _use_json_parser);
+       engine_config_hosted_tflite_model(engine_cfg, PLD_TFLITE_WEIGHT_MOBILENET_V1_POSENET_257_PATH,
+                                                                         NULL, _use_json_parser, _target_device_type);
 
        if (!_use_json_parser) {
                const char *inputNodeName = "sub_2";
@@ -72,9 +71,9 @@ TEST_P(TestPoseLandmarkDetection, CPU_TFLITE_MobilenetV1)
        inferencePoseLandmark();
 }
 
-INSTANTIATE_TEST_CASE_P(Prefix, TestPoseLandmarkDetection,
+INSTANTIATE_TEST_CASE_P(Prefix, TestPoseLandmarkDetectionTflite,
                                                ::testing::Values(
-                                                       ParamTypeOne(false),
-                                                       ParamTypeOne(true)
+                                                       ParamTypes(false, MV_INFERENCE_TARGET_DEVICE_CPU),
+                                                       ParamTypes(true, MV_INFERENCE_TARGET_DEVICE_CPU)
                                                )
 );
\ No newline at end of file