cmake_minimum_required(VERSION 3.13)
pkg_check_modules(${PROJECT_NAME}_DEP REQUIRED inference-engine-interface-common iniparser json-glib-1.0)
-file(GLOB MV_INFERENCE_SOURCE_LIST "${PROJECT_SOURCE_DIR}/src/*.c" "${PROJECT_SOURCE_DIR}/src/*.cpp")
+file(GLOB MV_INFERENCE_SOURCE_LIST "${PROJECT_SOURCE_DIR}/src/*.cpp")
find_package(OpenCV REQUIRED dnn imgproc)
if(NOT OpenCV_FOUND)
+++ /dev/null
-/**
- * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "mv_private.h"
-#include "mv_feature_key.h"
-#include "mv_inference.h"
-#include "mv_inference_open.h"
-
-/**
- * @file mv_inference.c
- * @brief This file contains Media Vision inference module.
- */
-
-static const char *feature_keys[] = { "http://tizen.org/feature/vision.inference.image",
- "http://tizen.org/feature/vision.inference.face" };
-static const size_t num_keys = sizeof(feature_keys) / sizeof(char *);
-
-int mv_inference_create(mv_inference_h *infer)
-{
- MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
- MEDIA_VISION_NULL_ARG_CHECK(infer);
-
- MEDIA_VISION_FUNCTION_ENTER();
-
- int ret = MEDIA_VISION_ERROR_NONE;
-
- ret = mv_inference_create_open(infer);
-
- MEDIA_VISION_FUNCTION_LEAVE();
- return ret;
-}
-
-int mv_inference_destroy(mv_inference_h infer)
-{
- MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
- MEDIA_VISION_INSTANCE_CHECK(infer);
-
- MEDIA_VISION_FUNCTION_ENTER();
-
- int ret = MEDIA_VISION_ERROR_NONE;
-
- ret = mv_inference_destroy_open(infer);
-
- MEDIA_VISION_FUNCTION_LEAVE();
- return ret;
-}
-
-int mv_inference_configure(mv_inference_h infer, mv_engine_config_h engine_config)
-{
- MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
- MEDIA_VISION_INSTANCE_CHECK(infer);
- MEDIA_VISION_INSTANCE_CHECK(engine_config);
-
- MEDIA_VISION_FUNCTION_ENTER();
-
- int ret = MEDIA_VISION_ERROR_NONE;
-
- ret = mv_inference_configure_engine_open(infer, engine_config);
- if (ret != MEDIA_VISION_ERROR_NONE) {
- LOGE("Fail to configure engine and target");
- return ret;
- }
-
- MEDIA_VISION_FUNCTION_LEAVE();
- return ret;
-}
-
-int mv_inference_prepare(mv_inference_h infer)
-{
- MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
- MEDIA_VISION_INSTANCE_CHECK(infer);
-
- MEDIA_VISION_FUNCTION_ENTER();
-
- int ret = MEDIA_VISION_ERROR_NONE;
-
- ret = mv_inference_prepare_open(infer);
-
- MEDIA_VISION_FUNCTION_LEAVE();
- return ret;
-}
-
-int mv_inference_foreach_supported_engine(mv_inference_h infer, mv_inference_supported_engine_cb callback,
- void *user_data)
-{
- MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
- MEDIA_VISION_INSTANCE_CHECK(infer);
- MEDIA_VISION_NULL_ARG_CHECK(callback);
- MEDIA_VISION_FUNCTION_ENTER();
-
- int ret = MEDIA_VISION_ERROR_NONE;
-
- ret = mv_inference_foreach_supported_engine_open(infer, callback, user_data);
-
- MEDIA_VISION_FUNCTION_LEAVE();
-
- return ret;
-}
-
-int mv_inference_image_classify(mv_source_h source, mv_inference_h infer, mv_rectangle_s *roi,
- mv_inference_image_classified_cb classified_cb, void *user_data)
-{
- MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
- MEDIA_VISION_INSTANCE_CHECK(source);
- MEDIA_VISION_INSTANCE_CHECK(infer);
- MEDIA_VISION_NULL_ARG_CHECK(classified_cb);
-
- MEDIA_VISION_FUNCTION_ENTER();
-
- int ret = MEDIA_VISION_ERROR_NONE;
-
- ret = mv_inference_image_classify_open(source, infer, roi, classified_cb, user_data);
-
- MEDIA_VISION_FUNCTION_LEAVE();
-
- return ret;
-}
-
-int mv_inference_object_detect(mv_source_h source, mv_inference_h infer, mv_inference_object_detected_cb detected_cb,
- void *user_data)
-{
- MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
- MEDIA_VISION_INSTANCE_CHECK(source);
- MEDIA_VISION_INSTANCE_CHECK(infer);
- MEDIA_VISION_NULL_ARG_CHECK(detected_cb);
-
- MEDIA_VISION_FUNCTION_ENTER();
-
- int ret = MEDIA_VISION_ERROR_NONE;
-
- ret = mv_inference_object_detect_open(source, infer, detected_cb, user_data);
-
- MEDIA_VISION_FUNCTION_LEAVE();
-
- return ret;
-}
-
-int mv_inference_face_detect(mv_source_h source, mv_inference_h infer, mv_inference_face_detected_cb detected_cb,
- void *user_data)
-{
- MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
- MEDIA_VISION_INSTANCE_CHECK(source);
- MEDIA_VISION_INSTANCE_CHECK(infer);
- MEDIA_VISION_NULL_ARG_CHECK(detected_cb);
-
- MEDIA_VISION_FUNCTION_ENTER();
-
- int ret = MEDIA_VISION_ERROR_NONE;
-
- ret = mv_inference_face_detect_open(source, infer, detected_cb, user_data);
-
- MEDIA_VISION_FUNCTION_LEAVE();
-
- return ret;
-}
-
-int mv_inference_facial_landmark_detect(mv_source_h source, mv_inference_h infer, mv_rectangle_s *roi,
- mv_inference_facial_landmark_detected_cb detected_cb, void *user_data)
-{
- MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
- MEDIA_VISION_INSTANCE_CHECK(source);
- MEDIA_VISION_INSTANCE_CHECK(infer);
- MEDIA_VISION_NULL_ARG_CHECK(detected_cb);
-
- MEDIA_VISION_FUNCTION_ENTER();
-
- int ret = MEDIA_VISION_ERROR_NONE;
-
- ret = mv_inference_facial_landmark_detect_open(source, infer, roi, detected_cb, user_data);
-
- MEDIA_VISION_FUNCTION_LEAVE();
-
- return ret;
-}
-
-int mv_inference_pose_landmark_detect(mv_source_h source, mv_inference_h infer, mv_rectangle_s *roi,
- mv_inference_pose_landmark_detected_cb detected_cb, void *user_data)
-{
- MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
- MEDIA_VISION_INSTANCE_CHECK(source);
- MEDIA_VISION_INSTANCE_CHECK(infer);
- MEDIA_VISION_NULL_ARG_CHECK(detected_cb);
-
- MEDIA_VISION_FUNCTION_ENTER();
-
- int ret = MEDIA_VISION_ERROR_NONE;
-
- ret = mv_inference_pose_landmark_detect_open(source, infer, roi, detected_cb, user_data);
-
- MEDIA_VISION_FUNCTION_LEAVE();
-
- return ret;
-}
-
-int mv_inference_pose_get_number_of_poses(mv_inference_pose_result_h result, int *number_of_poses)
-{
- MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
- MEDIA_VISION_INSTANCE_CHECK(result);
-
- MEDIA_VISION_NULL_ARG_CHECK(number_of_poses);
-
- MEDIA_VISION_FUNCTION_ENTER();
-
- int ret = MEDIA_VISION_ERROR_NONE;
-
- ret = mv_inference_pose_get_number_of_poses_open(result, number_of_poses);
-
- MEDIA_VISION_FUNCTION_LEAVE();
-
- return ret;
-}
-
-int mv_inference_pose_get_number_of_landmarks(mv_inference_pose_result_h result, int *number_of_landmarks)
-{
- MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
- MEDIA_VISION_INSTANCE_CHECK(result);
-
- MEDIA_VISION_NULL_ARG_CHECK(number_of_landmarks);
-
- MEDIA_VISION_FUNCTION_ENTER();
-
- int ret = MEDIA_VISION_ERROR_NONE;
-
- ret = mv_inference_pose_get_number_of_landmarks_open(result, number_of_landmarks);
-
- MEDIA_VISION_FUNCTION_LEAVE();
-
- return ret;
-}
-
-int mv_inference_pose_get_landmark(mv_inference_pose_result_h result, int pose_index, int part_index,
- mv_point_s *location, float *score)
-{
- MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
- MEDIA_VISION_INSTANCE_CHECK(result);
-
- MEDIA_VISION_NULL_ARG_CHECK(location);
- MEDIA_VISION_NULL_ARG_CHECK(score);
-
- if (pose_index < 0 || part_index < 0)
- return MEDIA_VISION_ERROR_INVALID_PARAMETER;
-
- MEDIA_VISION_FUNCTION_ENTER();
-
- int ret = MEDIA_VISION_ERROR_NONE;
-
- ret = mv_inference_pose_get_landmark_open(result, pose_index, part_index, location, score);
-
- MEDIA_VISION_FUNCTION_LEAVE();
-
- return ret;
-}
-
-int mv_inference_pose_get_label(mv_inference_pose_result_h result, int pose_index, int *label)
-{
- MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
- MEDIA_VISION_INSTANCE_CHECK(result);
-
- MEDIA_VISION_NULL_ARG_CHECK(label);
-
- if (pose_index < 0)
- return MEDIA_VISION_ERROR_INVALID_PARAMETER;
-
- MEDIA_VISION_FUNCTION_ENTER();
-
- int ret = MEDIA_VISION_ERROR_NONE;
-
- ret = mv_inference_pose_get_label_open(result, pose_index, label);
-
- MEDIA_VISION_FUNCTION_LEAVE();
-
- return ret;
-}
-
-int mv_pose_create(mv_pose_h *pose)
-{
- MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
- MEDIA_VISION_NULL_ARG_CHECK(pose);
-
- MEDIA_VISION_FUNCTION_ENTER();
-
- int ret = MEDIA_VISION_ERROR_NONE;
-
- ret = mv_pose_create_open(pose);
-
- MEDIA_VISION_FUNCTION_LEAVE();
-
- return ret;
-}
-
-int mv_pose_destroy(mv_pose_h pose)
-{
- MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
- MEDIA_VISION_INSTANCE_CHECK(pose);
-
- MEDIA_VISION_FUNCTION_ENTER();
-
- int ret = MEDIA_VISION_ERROR_NONE;
-
- ret = mv_pose_destroy_open(pose);
-
- MEDIA_VISION_FUNCTION_LEAVE();
-
- return ret;
-}
-
-int mv_pose_set_from_file(mv_pose_h pose, const char *motion_capture_file_path, const char *motion_mapping_file_path)
-{
- MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
- MEDIA_VISION_INSTANCE_CHECK(pose);
- MEDIA_VISION_NULL_ARG_CHECK(motion_capture_file_path);
- MEDIA_VISION_NULL_ARG_CHECK(motion_mapping_file_path);
-
- MEDIA_VISION_FUNCTION_ENTER();
-
- int ret = MEDIA_VISION_ERROR_NONE;
-
- ret = mv_pose_set_from_file_open(pose, motion_capture_file_path, motion_mapping_file_path);
-
- MEDIA_VISION_FUNCTION_LEAVE();
-
- return ret;
-}
-
-int mv_pose_compare(mv_pose_h pose, mv_inference_pose_result_h action, int parts, float *score)
-{
- MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
- MEDIA_VISION_INSTANCE_CHECK(pose);
- MEDIA_VISION_INSTANCE_CHECK(action);
- MEDIA_VISION_NULL_ARG_CHECK(score);
-
- MEDIA_VISION_FUNCTION_ENTER();
-
- int ret = MEDIA_VISION_ERROR_NONE;
-
- ret = mv_pose_compare_open(pose, action, parts, score);
-
- MEDIA_VISION_FUNCTION_LEAVE();
-
- return ret;
-}
--- /dev/null
+/**
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "mv_private.h"
+#include "mv_feature_key.h"
+#include "mv_inference.h"
+#include "mv_inference_open.h"
+
+/**
+ * @file mv_inference.cpp
+ * @brief This file contains Media Vision inference module.
+ */
+
+static const char *feature_keys[] = { "http://tizen.org/feature/vision.inference.image",
+ "http://tizen.org/feature/vision.inference.face" };
+static const size_t num_keys = sizeof(feature_keys) / sizeof(char *);
+
+int mv_inference_create(mv_inference_h *infer)
+{
+ MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
+ MEDIA_VISION_NULL_ARG_CHECK(infer);
+
+ MEDIA_VISION_FUNCTION_ENTER();
+
+ int ret = MEDIA_VISION_ERROR_NONE;
+
+ ret = mv_inference_create_open(infer);
+
+ MEDIA_VISION_FUNCTION_LEAVE();
+ return ret;
+}
+
+int mv_inference_destroy(mv_inference_h infer)
+{
+ MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
+ MEDIA_VISION_INSTANCE_CHECK(infer);
+
+ MEDIA_VISION_FUNCTION_ENTER();
+
+ int ret = MEDIA_VISION_ERROR_NONE;
+
+ ret = mv_inference_destroy_open(infer);
+
+ MEDIA_VISION_FUNCTION_LEAVE();
+ return ret;
+}
+
+int mv_inference_configure(mv_inference_h infer, mv_engine_config_h engine_config)
+{
+ MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
+ MEDIA_VISION_INSTANCE_CHECK(infer);
+ MEDIA_VISION_INSTANCE_CHECK(engine_config);
+
+ MEDIA_VISION_FUNCTION_ENTER();
+
+ int ret = MEDIA_VISION_ERROR_NONE;
+
+ ret = mv_inference_configure_engine_open(infer, engine_config);
+ if (ret != MEDIA_VISION_ERROR_NONE) {
+ LOGE("Fail to configure engine and target");
+ return ret;
+ }
+
+ MEDIA_VISION_FUNCTION_LEAVE();
+ return ret;
+}
+
+int mv_inference_prepare(mv_inference_h infer)
+{
+ MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
+ MEDIA_VISION_INSTANCE_CHECK(infer);
+
+ MEDIA_VISION_FUNCTION_ENTER();
+
+ int ret = MEDIA_VISION_ERROR_NONE;
+
+ ret = mv_inference_prepare_open(infer);
+
+ MEDIA_VISION_FUNCTION_LEAVE();
+ return ret;
+}
+
+int mv_inference_foreach_supported_engine(mv_inference_h infer, mv_inference_supported_engine_cb callback,
+ void *user_data)
+{
+ MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
+ MEDIA_VISION_INSTANCE_CHECK(infer);
+ MEDIA_VISION_NULL_ARG_CHECK(callback);
+ MEDIA_VISION_FUNCTION_ENTER();
+
+ int ret = MEDIA_VISION_ERROR_NONE;
+
+ ret = mv_inference_foreach_supported_engine_open(infer, callback, user_data);
+
+ MEDIA_VISION_FUNCTION_LEAVE();
+
+ return ret;
+}
+
+int mv_inference_image_classify(mv_source_h source, mv_inference_h infer, mv_rectangle_s *roi,
+ mv_inference_image_classified_cb classified_cb, void *user_data)
+{
+ MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
+ MEDIA_VISION_INSTANCE_CHECK(source);
+ MEDIA_VISION_INSTANCE_CHECK(infer);
+ MEDIA_VISION_NULL_ARG_CHECK(classified_cb);
+
+ MEDIA_VISION_FUNCTION_ENTER();
+
+ int ret = MEDIA_VISION_ERROR_NONE;
+
+ ret = mv_inference_image_classify_open(source, infer, roi, classified_cb, user_data);
+
+ MEDIA_VISION_FUNCTION_LEAVE();
+
+ return ret;
+}
+
+int mv_inference_object_detect(mv_source_h source, mv_inference_h infer, mv_inference_object_detected_cb detected_cb,
+ void *user_data)
+{
+ MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
+ MEDIA_VISION_INSTANCE_CHECK(source);
+ MEDIA_VISION_INSTANCE_CHECK(infer);
+ MEDIA_VISION_NULL_ARG_CHECK(detected_cb);
+
+ MEDIA_VISION_FUNCTION_ENTER();
+
+ int ret = MEDIA_VISION_ERROR_NONE;
+
+ ret = mv_inference_object_detect_open(source, infer, detected_cb, user_data);
+
+ MEDIA_VISION_FUNCTION_LEAVE();
+
+ return ret;
+}
+
+int mv_inference_face_detect(mv_source_h source, mv_inference_h infer, mv_inference_face_detected_cb detected_cb,
+ void *user_data)
+{
+ MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
+ MEDIA_VISION_INSTANCE_CHECK(source);
+ MEDIA_VISION_INSTANCE_CHECK(infer);
+ MEDIA_VISION_NULL_ARG_CHECK(detected_cb);
+
+ MEDIA_VISION_FUNCTION_ENTER();
+
+ int ret = MEDIA_VISION_ERROR_NONE;
+
+ ret = mv_inference_face_detect_open(source, infer, detected_cb, user_data);
+
+ MEDIA_VISION_FUNCTION_LEAVE();
+
+ return ret;
+}
+
+int mv_inference_facial_landmark_detect(mv_source_h source, mv_inference_h infer, mv_rectangle_s *roi,
+ mv_inference_facial_landmark_detected_cb detected_cb, void *user_data)
+{
+ MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
+ MEDIA_VISION_INSTANCE_CHECK(source);
+ MEDIA_VISION_INSTANCE_CHECK(infer);
+ MEDIA_VISION_NULL_ARG_CHECK(detected_cb);
+
+ MEDIA_VISION_FUNCTION_ENTER();
+
+ int ret = MEDIA_VISION_ERROR_NONE;
+
+ ret = mv_inference_facial_landmark_detect_open(source, infer, roi, detected_cb, user_data);
+
+ MEDIA_VISION_FUNCTION_LEAVE();
+
+ return ret;
+}
+
+int mv_inference_pose_landmark_detect(mv_source_h source, mv_inference_h infer, mv_rectangle_s *roi,
+ mv_inference_pose_landmark_detected_cb detected_cb, void *user_data)
+{
+ MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
+ MEDIA_VISION_INSTANCE_CHECK(source);
+ MEDIA_VISION_INSTANCE_CHECK(infer);
+ MEDIA_VISION_NULL_ARG_CHECK(detected_cb);
+
+ MEDIA_VISION_FUNCTION_ENTER();
+
+ int ret = MEDIA_VISION_ERROR_NONE;
+
+ ret = mv_inference_pose_landmark_detect_open(source, infer, roi, detected_cb, user_data);
+
+ MEDIA_VISION_FUNCTION_LEAVE();
+
+ return ret;
+}
+
+int mv_inference_pose_get_number_of_poses(mv_inference_pose_result_h result, int *number_of_poses)
+{
+ MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
+ MEDIA_VISION_INSTANCE_CHECK(result);
+
+ MEDIA_VISION_NULL_ARG_CHECK(number_of_poses);
+
+ MEDIA_VISION_FUNCTION_ENTER();
+
+ int ret = MEDIA_VISION_ERROR_NONE;
+
+ ret = mv_inference_pose_get_number_of_poses_open(result, number_of_poses);
+
+ MEDIA_VISION_FUNCTION_LEAVE();
+
+ return ret;
+}
+
+int mv_inference_pose_get_number_of_landmarks(mv_inference_pose_result_h result, int *number_of_landmarks)
+{
+ MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
+ MEDIA_VISION_INSTANCE_CHECK(result);
+
+ MEDIA_VISION_NULL_ARG_CHECK(number_of_landmarks);
+
+ MEDIA_VISION_FUNCTION_ENTER();
+
+ int ret = MEDIA_VISION_ERROR_NONE;
+
+ ret = mv_inference_pose_get_number_of_landmarks_open(result, number_of_landmarks);
+
+ MEDIA_VISION_FUNCTION_LEAVE();
+
+ return ret;
+}
+
+int mv_inference_pose_get_landmark(mv_inference_pose_result_h result, int pose_index, int part_index,
+ mv_point_s *location, float *score)
+{
+ MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
+ MEDIA_VISION_INSTANCE_CHECK(result);
+
+ MEDIA_VISION_NULL_ARG_CHECK(location);
+ MEDIA_VISION_NULL_ARG_CHECK(score);
+
+ if (pose_index < 0 || part_index < 0)
+ return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+
+ MEDIA_VISION_FUNCTION_ENTER();
+
+ int ret = MEDIA_VISION_ERROR_NONE;
+
+ ret = mv_inference_pose_get_landmark_open(result, pose_index, part_index, location, score);
+
+ MEDIA_VISION_FUNCTION_LEAVE();
+
+ return ret;
+}
+
+int mv_inference_pose_get_label(mv_inference_pose_result_h result, int pose_index, int *label)
+{
+ MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
+ MEDIA_VISION_INSTANCE_CHECK(result);
+
+ MEDIA_VISION_NULL_ARG_CHECK(label);
+
+ if (pose_index < 0)
+ return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+
+ MEDIA_VISION_FUNCTION_ENTER();
+
+ int ret = MEDIA_VISION_ERROR_NONE;
+
+ ret = mv_inference_pose_get_label_open(result, pose_index, label);
+
+ MEDIA_VISION_FUNCTION_LEAVE();
+
+ return ret;
+}
+
+int mv_pose_create(mv_pose_h *pose)
+{
+ MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
+ MEDIA_VISION_NULL_ARG_CHECK(pose);
+
+ MEDIA_VISION_FUNCTION_ENTER();
+
+ int ret = MEDIA_VISION_ERROR_NONE;
+
+ ret = mv_pose_create_open(pose);
+
+ MEDIA_VISION_FUNCTION_LEAVE();
+
+ return ret;
+}
+
+int mv_pose_destroy(mv_pose_h pose)
+{
+ MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
+ MEDIA_VISION_INSTANCE_CHECK(pose);
+
+ MEDIA_VISION_FUNCTION_ENTER();
+
+ int ret = MEDIA_VISION_ERROR_NONE;
+
+ ret = mv_pose_destroy_open(pose);
+
+ MEDIA_VISION_FUNCTION_LEAVE();
+
+ return ret;
+}
+
+int mv_pose_set_from_file(mv_pose_h pose, const char *motion_capture_file_path, const char *motion_mapping_file_path)
+{
+ MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
+ MEDIA_VISION_INSTANCE_CHECK(pose);
+ MEDIA_VISION_NULL_ARG_CHECK(motion_capture_file_path);
+ MEDIA_VISION_NULL_ARG_CHECK(motion_mapping_file_path);
+
+ MEDIA_VISION_FUNCTION_ENTER();
+
+ int ret = MEDIA_VISION_ERROR_NONE;
+
+ ret = mv_pose_set_from_file_open(pose, motion_capture_file_path, motion_mapping_file_path);
+
+ MEDIA_VISION_FUNCTION_LEAVE();
+
+ return ret;
+}
+
+int mv_pose_compare(mv_pose_h pose, mv_inference_pose_result_h action, int parts, float *score)
+{
+ MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
+ MEDIA_VISION_INSTANCE_CHECK(pose);
+ MEDIA_VISION_INSTANCE_CHECK(action);
+ MEDIA_VISION_NULL_ARG_CHECK(score);
+
+ MEDIA_VISION_FUNCTION_ENTER();
+
+ int ret = MEDIA_VISION_ERROR_NONE;
+
+ ret = mv_pose_compare_open(pose, action, parts, score);
+
+ MEDIA_VISION_FUNCTION_LEAVE();
+
+ return ret;
+}