--- /dev/null
+{
+ "inputmetadata" :
+ {
+ "tensor_info" : [
+ {
+ "name" : "Placeholder",
+ "shape_type" : 1,
+ "shape_dims" : [ 1, 128, 128, 3],
+ "data_type" : 0,
+ "color_space" : "RGB888"
+ }
+ ],
+ "preprocess" : [
+ {
+ "normalization" : [
+ {
+ "mean" : [0.0, 0.0, 0.0],
+ "std" : [1.0, 1.0, 1.0]
+ }
+ ]
+ }
+ ]
+ },
+ "outputmetadata" :
+ {
+ "score" : [
+ {
+ "name" : "fanet8ss_inference/fully_connected_1/Sigmoid",
+ "index" : [-1, -1, -1, -1],
+ "top_number" : 1,
+ "threshold" : 0.0,
+ "score_type" : 0
+ }
+ ],
+ "landmark" : [
+ {
+ "name" : "fanet8ss_inference/fully_connected_1/Sigmoid",
+ "index" : [-1, 1],
+ "landmark_type" : 0,
+ "landmark_coordinate" : 0,
+ "landmark_offset" : 2,
+ "decoding_type" : 0
+ }
+ ]
+ }
+}
#define FLD_OPENCV_CONFIG_CAFFE_PATH \
"/usr/share/capi-media-vision/models/FLD/caffe/fld_caffe_model_tweak.prototxt"
+/*
+ * Hosted models
+ */
+#define FLD_TFLITE_WIEGHT_TWEAKCNN_128_PATH \
+ "/usr/share/capi-media-vision/models/FLD/tflite/fld_tweakcnn_128x128.tflite"
+#define FLD_TFLITE_WIEGHT_MEDIAPIPE_192_PATH \
+ "/usr/share/capi-media-vision/models/FLD/tflite/fld_mediapipe_192x192.tflite"
+
//Pose Detection
#define PLD_TFLITE_WEIGHT_PATH \
"/usr/share/capi-media-vision/models/PLD/tflite/pld-tflite-001.tflite"
return err;
}
+
+int perform_hosted_tflite_tweakCNN_128_config(mv_engine_config_h *engine_cfg)
+{
+ int err = MEDIA_VISION_ERROR_NONE;
+
+ mv_engine_config_h handle = NULL;
+ err = mv_create_engine_config(&handle);
+ if (err != MEDIA_VISION_ERROR_NONE) {
+ printf("Fail to create engine configuration handle.\n");
+ if (handle) {
+ int err2 = mv_destroy_engine_config(handle);
+ if (err2 != MEDIA_VISION_ERROR_NONE) {
+ printf("Fail to destroy engine configuration.\n");
+ }
+ }
+ return err;
+ }
+
+ mv_engine_config_set_string_attribute(handle,
+ MV_INFERENCE_MODEL_WEIGHT_FILE_PATH,
+ FLD_TFLITE_WIEGHT_TWEAKCNN_128_PATH);
+
+ mv_engine_config_set_int_attribute(handle, MV_INFERENCE_BACKEND_TYPE,
+ MV_INFERENCE_BACKEND_TFLITE);
+
+ mv_engine_config_set_int_attribute(handle, MV_INFERENCE_TARGET_TYPE,
+ MV_INFERENCE_TARGET_CPU);
+
+ *engine_cfg = handle;
+ return err;
+}
+
+int perform_hosted_tflite_mediapipe_192_config(mv_engine_config_h *engine_cfg)
+{
+ int err = MEDIA_VISION_ERROR_NONE;
+
+ mv_engine_config_h handle = NULL;
+ err = mv_create_engine_config(&handle);
+ if (err != MEDIA_VISION_ERROR_NONE) {
+ printf("Fail to create engine configuration handle.\n");
+ if (handle) {
+ int err2 = mv_destroy_engine_config(handle);
+ if (err2 != MEDIA_VISION_ERROR_NONE) {
+ printf("Fail to destroy engine configuration.\n");
+ }
+ }
+ return err;
+ }
+
+ mv_engine_config_set_string_attribute(handle,
+ MV_INFERENCE_MODEL_WEIGHT_FILE_PATH,
+ FLD_TFLITE_WIEGHT_MEDIAPIPE_192_PATH);
+
+ mv_engine_config_set_int_attribute(handle, MV_INFERENCE_BACKEND_TYPE,
+ MV_INFERENCE_BACKEND_TFLITE);
+
+ mv_engine_config_set_int_attribute(handle, MV_INFERENCE_TARGET_TYPE,
+ MV_INFERENCE_TARGET_CPU);
+
+ *engine_cfg = handle;
+ return err;
+}
+
int perform_facial_landmark_detection()
{
int err = MEDIA_VISION_ERROR_NONE;
int sel_opt = 0;
- const int options[] = { 1, 2, 3, 4, 5, 6 };
+ const int options[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
const char *names[] = { "Configuration",
"Tflite(CPU) + TweakCNN",
"OPENCV(CPU) + TweakCNN",
+ "Hosted: TFLite(TweakCNN)",
+ "Hosted: TFLite(MediaPipe)",
"Prepare",
"Run",
"Back" };
err = perform_opencv_cnncascade(&engine_cfg);
} break;
case 4: {
+ //perform Hosted TweakCNN config
+ if (engine_cfg) {
+ int err2 = mv_destroy_engine_config(engine_cfg);
+ if (err2 != MEDIA_VISION_ERROR_NONE)
+ printf("Fail to destroy engine_cfg [err:%i]\n", err2);
+ engine_cfg = NULL;
+ }
+ err = perform_hosted_tflite_tweakCNN_128_config(&engine_cfg);
+ } break;
+ case 5: {
+ //perform Hosted MediaPipe config
+ if (engine_cfg) {
+ int err2 = mv_destroy_engine_config(engine_cfg);
+ if (err2 != MEDIA_VISION_ERROR_NONE)
+ printf("Fail to destroy engine_cfg [err:%i]\n", err2);
+ engine_cfg = NULL;
+ }
+ err = perform_hosted_tflite_mediapipe_192_config(&engine_cfg);
+ } break;
+ case 6: {
// create - configure - prepare
if (infer) {
int err2 = mv_inference_destroy(infer);
break;
}
} break;
- case 5: {
+ case 7: {
if (mvSource) {
int err2 = mv_destroy_source(mvSource);
if (err2 != MEDIA_VISION_ERROR_NONE)
unsigned long timeDiff = gettotalmillisec(diffspec);
printf("elapsed time : %lu(ms)\n", timeDiff);
} break;
- case 6: {
+ case 8: {
//perform destroy
if (engine_cfg) {
err = mv_destroy_engine_config(engine_cfg);