#define OD_SNPE_WEIGHT_QC_EFFCIENTDET_LITE2_448_PATH \
MV_CONFIG_PATH \
"/models/OD/snpe/lite2_fp32.dlc"
+#define OD_LABEL_MOBILENET_V2_SSD_320_PATH \
+ MV_CONFIG_PATH \
+ "/models/OD/tflite/od_mobilenet_v2_ssd_label.txt"
+#define OD_TFLITE_WEIGHT_MOBILENET_V2_SSD_320_PATH \
+ MV_CONFIG_PATH \
+ "/models/OD/tflite/od_mobilenet_v2_ssd_320x320.tflite"
void _object_detected_cb(mv_source_h source, const int number_of_objects, const int *indices, const char **names,
const float *confidences, const mv_rectangle_s *locations, void *user_data)
class TestObjectDetectionTflite : public TestInference
{
public:
- void inferenceDog()
+ void inferenceDog(std::string &answer)
{
- std::string result("Dog");
TestInference::ConfigureInference();
ASSERT_EQ(MediaVision::Common::ImageHelper::loadImageToSource(IMG_DOG, mv_source), MEDIA_VISION_ERROR_NONE);
- ASSERT_EQ(mv_inference_object_detect(mv_source, infer, _object_detected_cb, &result), MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_inference_object_detect(mv_source, infer, _object_detected_cb, &answer), MEDIA_VISION_ERROR_NONE);
}
};
MEDIA_VISION_ERROR_NONE);
}
- inferenceDog();
+ std::string answer("Dog");
+ inferenceDog(answer);
+}
+
+TEST_P(TestObjectDetectionTflite, MobilenetV2_SSD)
+{
+ engine_config_hosted_tflite_model(engine_cfg, OD_TFLITE_WEIGHT_MOBILENET_V2_SSD_320_PATH,
+ OD_LABEL_MOBILENET_V2_SSD_320_PATH, _use_json_parser, _target_device_type);
+
+ if (_use_json_parser) {
+ std::string answer("dog");
+ inferenceDog(answer);
+ }
}
INSTANTIATE_TEST_CASE_P(Prefix, TestObjectDetectionTflite,
public:
void inferenceDog()
{
- std::string result("dog");
+ std::string answer("dog");
TestInference::ConfigureInference();
ASSERT_EQ(MediaVision::Common::ImageHelper::loadImageToSource(IMG_DOG, mv_source), MEDIA_VISION_ERROR_NONE);
- ASSERT_EQ(mv_inference_object_detect(mv_source, infer, _object_detected_cb, &result), MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_inference_object_detect(mv_source, infer, _object_detected_cb, &answer), MEDIA_VISION_ERROR_NONE);
}
};