#define PLD_LABEL_MOBILENET_V1_POSENET_257_PATH \
"/usr/share/capi-media-vision/models/PLD/tflite/pld_mobilenet_v1_posenet_multi_label.txt"
+// https://tfhub.dev/google/lite-model/movenet/singlepose/lightning/tflite/int8/4
+#define PLD_TFLITE_WEIGHT_INT8_MOVENET_PATH \
+ "/usr/share/capi-media-vision/models/PLD/tflite/pld_int8_movenet.tflite"
+
/******
* Public model:
* IC: mobilenet caffe, tf?
return err;
}
+int perform_hosted_tflite_int8_movenet(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,
+ PLD_TFLITE_WEIGHT_INT8_MOVENET_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_pose_landmark_detection()
{
int err = MEDIA_VISION_ERROR_NONE;
"TFLITE(CPU) + CPM",
"Hosted: TFLITE(CPU) + CPM",
"Hosted: TFLITE(CPU) + MOBILENET_V1_POSENET",
+ "Hosted: TFLITE(CPU) + INT8_MOVENET",
"Prepare",
"Run",
"Back" };
err = perform_hosted_tflite_mobilenet_v1_posenet_257_config(&engine_cfg);
} break;
case 5: {
+ //perform int8 movenet
+ 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_mobilenet_v1_posenet_257_config(&engine_cfg);
+ } break;
+ case 6: {
// create - configure - prepare
if (infer) {
int err2 = mv_inference_destroy(infer);
break;
}
} break;
- case 6: {
+ 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 7: {
+ case 8: {
//perform destroy
if (engine_cfg) {
err = mv_destroy_engine_config(engine_cfg);