summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInki Dae <inki.dae@samsung.com>2023-11-20 14:36:49 +0900
committerInki Dae <inki.dae@samsung.com>2023-12-07 10:39:54 +0900
commitf38bec137d42238b27645c75001a2e7fda96bf74 (patch)
tree0f261d0bf2dd8e056677b736a424d9d5fcad7ee5
parent209fd20f297fa7548f9fe3d0bd6b80a3db27b154 (diff)
downloadmediavision-f38bec137d42238b27645c75001a2e7fda96bf74.tar.gz
mediavision-f38bec137d42238b27645c75001a2e7fda96bf74.tar.bz2
mediavision-f38bec137d42238b27645c75001a2e7fda96bf74.zip
mv_machine_learning: add a new feature key checking functionaccepted/tizen/7.0/unified/20240104.170600
[Version] : 0.23.51 [Issue type] : bug fix Add a new feature key checking function for machine learning based face recognition API. In the previous version of face recognition API, we used below key only. http://tizen.org/feature/vision.inference.face However, the key is used by face detection and other API - key checking duplicated. So add a new feature key checking function so that the face recognition API can check four keys - http://tizen.org/feature/vision.inference - http://tizen.org/feature/vision.training - http://tizen.org/feature/vision.inference.face_recognition - http://tizen.org/feature/vision.training.face_recognition Change-Id: I9ad4cc5e166ba0aa644a99d4891a8dd927886039 Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r--doc/mediavision_doc.h8
-rw-r--r--include/mv_private.h4
-rw-r--r--mv_common/src/mv_private.c79
-rw-r--r--mv_machine_learning/face_recognition/src/mv_face_recognition.c21
-rw-r--r--packaging/capi-media-vision.spec2
5 files changed, 105 insertions, 9 deletions
diff --git a/doc/mediavision_doc.h b/doc/mediavision_doc.h
index c79eb868..ef772894 100644
--- a/doc/mediavision_doc.h
+++ b/doc/mediavision_doc.h
@@ -66,6 +66,9 @@
* - %http://tizen.org/feature/vision.face_recognition\n
* - %http://tizen.org/feature/vision.image_recognition\n
* - %http://tizen.org/feature/vision.inference\n
+ * - %http://tizen.org/feature/vision.training\n
+ * - %http://tizen.org/feature/vision.inference.face_recognition\n
+ * - %http://tizen.org/feature/vision.training.face_recognition\n
* - %http://tizen.org/feature/vision.inference.image\n
* - %http://tizen.org/feature/vision.inference.face\n
*
@@ -422,7 +425,10 @@
*
* @section CAPI_MEDIA_VISION_FACE_RECOGNITION_MODULE_FEATURE Related Features
* This API is related with the following features:\n
- * - %http://tizen.org/feature/vision.face_recognition\n
+ * - %http://tizen.org/feature/vision.inference\n
+ * - %http://tizen.org/feature/vision.training\n
+ * - %http://tizen.org/feature/vision.inference.face_recognition\n
+ * - %http://tizen.org/feature/vision.training.face_recognition\n
*
* It is recommended to design feature related codes in your application for
* reliability.\n
diff --git a/include/mv_private.h b/include/mv_private.h
index 94c5a7ba..b1a16b33 100644
--- a/include/mv_private.h
+++ b/include/mv_private.h
@@ -66,8 +66,12 @@ bool _mv_barcode_generate_check_system_info_feature_supported(void);
bool _mv_face_check_system_info_feature_supported(void);
bool _mv_image_check_system_info_feature_supported(void);
bool _mv_inference_check_system_info_feature_supported(void);
+bool _mv_inference_group_check_system_info_feature_supported(void);
+bool _mv_training_group_check_system_info_feature_supported(void);
bool _mv_inference_image_check_system_info_feature_supported(void);
bool _mv_inference_face_check_system_info_feature_supported(void);
+bool _mv_inference_face_recognition_check_system_info_feature_supported(void);
+bool _mv_training_face_recognition_check_system_info_feature_supported(void);
bool _mv_roi_tracking_check_system_info_feature_supported(void);
bool _mv_3d_all_check_system_info_feature_supported(void);
bool _mv_3d_check_system_info_feature_supported(void);
diff --git a/mv_common/src/mv_private.c b/mv_common/src/mv_private.c
index a4884b3e..f43e73a8 100644
--- a/mv_common/src/mv_private.c
+++ b/mv_common/src/mv_private.c
@@ -161,6 +161,85 @@ bool _mv_face_check_system_info_feature_supported(void)
return isFaceRecognitionSupported;
}
+bool _mv_inference_group_check_system_info_feature_supported(void)
+{
+ bool isInferenceSupported = false;
+
+ const int nRetVal =
+ system_info_get_platform_bool("http://tizen.org/feature/vision.inference", &isInferenceSupported);
+
+ if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+ LOGE("SYSTEM_INFO_ERROR: vision.inference");
+ return false;
+ }
+
+ isInferenceSupported ? LOGI("system_info_get_platform_bool returned "
+ "Supported inference group feature capability\n") :
+ LOGE("system_info_get_platform_bool returned "
+ "Unsupported inference group feature capability\n");
+
+ return (isInferenceSupported);
+}
+
+bool _mv_training_group_check_system_info_feature_supported(void)
+{
+ bool isTrainingSupported = false;
+
+ const int nRetVal = system_info_get_platform_bool("http://tizen.org/feature/vision.training", &isTrainingSupported);
+
+ if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+ LOGE("SYSTEM_INFO_ERROR: vision.training");
+ return false;
+ }
+
+ isTrainingSupported ? LOGI("system_info_get_platform_bool returned "
+ "Supported training group feature capability\n") :
+ LOGE("system_info_get_platform_bool returned "
+ "Unsupported training group feature capability\n");
+
+ return (isTrainingSupported);
+}
+
+bool _mv_inference_face_recognition_check_system_info_feature_supported(void)
+{
+ bool isInferenceFaceSupported = false;
+
+ const int nRetVal = system_info_get_platform_bool("http://tizen.org/feature/vision.inference.face_recognition",
+ &isInferenceFaceSupported);
+
+ if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+ LOGE("SYSTEM_INFO_ERROR: vision.inference.face_recognition");
+ return false;
+ }
+
+ isInferenceFaceSupported ? LOGI("system_info_get_platform_bool returned "
+ "Supported inference face recognition feature capability\n") :
+ LOGE("system_info_get_platform_bool returned "
+ "Unsupported inference face recognition feature capability\n");
+
+ return (_mv_inference_group_check_system_info_feature_supported() && isInferenceFaceSupported);
+}
+
+bool _mv_training_face_recognition_check_system_info_feature_supported(void)
+{
+ bool isFaceRecognitionSupported = false;
+
+ const int nRetVal = system_info_get_platform_bool("http://tizen.org/feature/vision.training.face_recognition",
+ &isFaceRecognitionSupported);
+
+ if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+ LOGE("SYSTEM_INFO_ERROR: vision.training.face_recognition");
+ return false;
+ }
+
+ isFaceRecognitionSupported ? LOGI("system_info_get_platform_bool returned "
+ "Supported training face recognition feature capability\n") :
+ LOGE("system_info_get_platform_bool returned "
+ "Unsupported training face recognition feature capability\n");
+
+ return (_mv_training_group_check_system_info_feature_supported() && isFaceRecognitionSupported);
+}
+
bool _mv_image_check_system_info_feature_supported(void)
{
bool isImageRecognitionSupported = false;
diff --git a/mv_machine_learning/face_recognition/src/mv_face_recognition.c b/mv_machine_learning/face_recognition/src/mv_face_recognition.c
index 1a7cd6ae..a6779d5b 100644
--- a/mv_machine_learning/face_recognition/src/mv_face_recognition.c
+++ b/mv_machine_learning/face_recognition/src/mv_face_recognition.c
@@ -20,7 +20,8 @@
int mv_face_recognition_create(mv_face_recognition_h *out_handle)
{
- MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+ MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_recognition_check_system_info_feature_supported());
+ MEDIA_VISION_SUPPORT_CHECK(_mv_training_face_recognition_check_system_info_feature_supported());
MEDIA_VISION_NULL_ARG_CHECK(out_handle);
@@ -37,7 +38,8 @@ int mv_face_recognition_create(mv_face_recognition_h *out_handle)
int mv_face_recognition_destroy(mv_face_recognition_h handle)
{
- MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+ MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_recognition_check_system_info_feature_supported());
+ MEDIA_VISION_SUPPORT_CHECK(_mv_training_face_recognition_check_system_info_feature_supported());
MEDIA_VISION_INSTANCE_CHECK(handle);
@@ -54,7 +56,8 @@ int mv_face_recognition_destroy(mv_face_recognition_h handle)
int mv_face_recognition_prepare(mv_face_recognition_h handle)
{
- MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+ MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_recognition_check_system_info_feature_supported());
+ MEDIA_VISION_SUPPORT_CHECK(_mv_training_face_recognition_check_system_info_feature_supported());
MEDIA_VISION_INSTANCE_CHECK(handle);
@@ -71,7 +74,8 @@ int mv_face_recognition_prepare(mv_face_recognition_h handle)
int mv_face_recognition_register(mv_face_recognition_h handle, mv_source_h source, const char *label)
{
- MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+ MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_recognition_check_system_info_feature_supported());
+ MEDIA_VISION_SUPPORT_CHECK(_mv_training_face_recognition_check_system_info_feature_supported());
MEDIA_VISION_INSTANCE_CHECK(handle);
MEDIA_VISION_INSTANCE_CHECK(source);
@@ -90,7 +94,8 @@ int mv_face_recognition_register(mv_face_recognition_h handle, mv_source_h sourc
int mv_face_recognition_unregister(mv_face_recognition_h handle, const char *label)
{
- MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+ MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_recognition_check_system_info_feature_supported());
+ MEDIA_VISION_SUPPORT_CHECK(_mv_training_face_recognition_check_system_info_feature_supported());
MEDIA_VISION_INSTANCE_CHECK(handle);
MEDIA_VISION_INSTANCE_CHECK(label);
@@ -108,7 +113,8 @@ int mv_face_recognition_unregister(mv_face_recognition_h handle, const char *lab
int mv_face_recognition_inference(mv_face_recognition_h handle, mv_source_h source)
{
- MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+ MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_recognition_check_system_info_feature_supported());
+ MEDIA_VISION_SUPPORT_CHECK(_mv_training_face_recognition_check_system_info_feature_supported());
MEDIA_VISION_INSTANCE_CHECK(handle);
MEDIA_VISION_INSTANCE_CHECK(source);
@@ -126,7 +132,8 @@ int mv_face_recognition_inference(mv_face_recognition_h handle, mv_source_h sour
int mv_face_recognition_get_label(mv_face_recognition_h handle, const char **out_label)
{
- MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+ MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_recognition_check_system_info_feature_supported());
+ MEDIA_VISION_SUPPORT_CHECK(_mv_training_face_recognition_check_system_info_feature_supported());
MEDIA_VISION_INSTANCE_CHECK(handle);
MEDIA_VISION_INSTANCE_CHECK(out_label);
diff --git a/packaging/capi-media-vision.spec b/packaging/capi-media-vision.spec
index 09c1b470..f5249e6c 100644
--- a/packaging/capi-media-vision.spec
+++ b/packaging/capi-media-vision.spec
@@ -1,6 +1,6 @@
Name: capi-media-vision
Summary: Media Vision library for Tizen Native API
-Version: 0.23.50
+Version: 0.23.51
Release: 3
Group: Multimedia/Framework
License: Apache-2.0 and BSD-3-Clause