int OutputMetadata::ParseBox(JsonObject *root)
{
if (!json_object_has_member(root, "box")) {
- LOGE("No box outputmetadata");
+ LOGI("No box outputmetadata");
return MEDIA_VISION_ERROR_NONE;
}
MV_CONFIG_PATH \
"/res/inference/images/faceLandmark.jpg"
+#define FLD_TFLITE_WIEGHT_TWEAKCNN_128_PATH \
+ MV_CONFIG_PATH \
+ "models/FLD/tflite/fld_tweakcnn_128x128.tflite"
+#define FLD_TFLITE_META_TWEAKCNN_128_PATH \
+ MV_CONFIG_PATH \
+ "models/FLD/tflite/fld_tweakcnn_128x128.json"
+
void _facial_landmark_detected_cb(mv_source_h source, const int number_of_landmarks, const mv_point_s *locations,
void *user_data)
{
INSTANTIATE_TEST_CASE_P(Prefix, TestFaceLandmarkDetectionOpenCV,
::testing::Values(ParamTypes(false, MV_INFERENCE_TARGET_DEVICE_CPU),
- ParamTypes(true, MV_INFERENCE_TARGET_DEVICE_CPU)));
\ No newline at end of file
+ ParamTypes(true, MV_INFERENCE_TARGET_DEVICE_CPU)));
+
+class TestFaceLandmarkDetectionTflite : public TestInference
+{
+public:
+ void inferenceFaceLandmark()
+ {
+ TestInference::ConfigureInference();
+
+ ASSERT_EQ(MediaVision::Common::ImageHelper::loadImageToSource(IMG_FACE_LANDMARK, mv_source),
+ MEDIA_VISION_ERROR_NONE);
+ ASSERT_EQ(mv_inference_facial_landmark_detect(mv_source, infer, NULL, _facial_landmark_detected_cb, NULL),
+ MEDIA_VISION_ERROR_NONE);
+ }
+};
+
+TEST_P(TestFaceLandmarkDetectionTflite, TweakCNN)
+{
+ engine_config_hosted_tflite_model(engine_cfg, FLD_TFLITE_WIEGHT_TWEAKCNN_128_PATH,
+ FLD_TFLITE_META_TWEAKCNN_128_PATH, _use_json_parser, _target_device_type);
+ if (_use_json_parser) {
+ inferenceFaceLandmark();
+ }
+}
+
+INSTANTIATE_TEST_CASE_P(Prefix, TestFaceLandmarkDetectionTflite,
+ ::testing::Values(ParamTypes(true, MV_INFERENCE_TARGET_DEVICE_CPU)));
\ No newline at end of file
#define IC_SNPE_WEIGHT_QUANT_INCEPTION_V3_299_PATH \
MV_CONFIG_PATH \
"/models/IC_Q/snpe/inception_v3_quantized.dlc"
+#define IC_LABEL_MOBILENET_V1_224_FOR_ITC_PATH \
+ MV_CONFIG_PATH \
+ "/models/IC/tflite/image-classification-label.txt"
+#define IC_TFLITE_WEIGHT_MOBILENET_V1_224_FOR_ITC_PATH \
+ MV_CONFIG_PATH \
+ "/models/IC/tflite/image-classification-001.tflite"
void _image_classified_cb(mv_source_h source, const int number_of_classes, const int *indices, const char **names,
const float *confidences, void *user_data)
{
const std::string answer = "banana";
+ const std::string answerWithCapital = "Banana";
auto answer_found = false;
for (int i = 0; i < number_of_classes; i++) {
- if (answer == names[i]) {
+ if (answer == names[i] || answerWithCapital == names[i]) {
answer_found = true;
break;
}
inferenceBanana();
}
+TEST_P(TestImageClassificationTflite, MobilenetV1ForITC)
+{
+ engine_config_hosted_tflite_model(engine_cfg, IC_TFLITE_WEIGHT_MOBILENET_V1_224_FOR_ITC_PATH,
+ IC_LABEL_MOBILENET_V1_224_FOR_ITC_PATH, _use_json_parser, _target_device_type);
+
+ if (_use_json_parser) {
+ inferenceBanana();
+ }
+}
+
TEST_P(TestImageClassificationTflite, MobilenetV2)
{
engine_config_hosted_tflite_model(engine_cfg, IC_TFLITE_WEIGHT_MOBILENET_V2_224_PATH,
MV_CONFIG_PATH \
"/res/inference/images/poseLandmark.jpg"
+#define PLD_TFLITE_WEIGHT_CPM_192_PATH \
+ MV_CONFIG_PATH \
+ "/models/PLD/tflite/pld_cpm_192x192.tflite"
+#define PLD_TFLITE_META_CPM_192_PATH \
+ MV_CONFIG_PATH \
+ "/models/PLD/tflite/pld_cpm_192x192.json"
+
void _pose_landmark_detected_cb(mv_source_h source, mv_inference_pose_result_h pose, void *user_data)
{
int cb_number_of_poses = 0;
inferencePoseLandmark();
}
+TEST_P(TestPoseLandmarkDetectionTflite, CPM)
+{
+ engine_config_hosted_tflite_model(engine_cfg, PLD_TFLITE_WEIGHT_CPM_192_PATH, NULL, _use_json_parser,
+ _target_device_type);
+
+ if (_use_json_parser) {
+ inferencePoseLandmark();
+ }
+}
+
INSTANTIATE_TEST_CASE_P(Prefix, TestPoseLandmarkDetectionTflite,
::testing::Values(ParamTypes(false, MV_INFERENCE_TARGET_DEVICE_CPU),
ParamTypes(true, MV_INFERENCE_TARGET_DEVICE_CPU)));
\ No newline at end of file