summaryrefslogtreecommitdiff
path: root/mv_common
diff options
context:
space:
mode:
authorInki Dae <inki.dae@samsung.com>2023-11-27 18:30:17 +0900
committerInki Dae <inki.dae@samsung.com>2023-12-13 10:09:23 +0000
commit19a023602202ae8e1abbfd6dfc4bae2f25e52858 (patch)
tree2c5631186080e64b892b67354515931ed95bea73 /mv_common
parentb0edfc540dc34ea46f93bbed959625e8faef8581 (diff)
downloadmediavision-19a023602202ae8e1abbfd6dfc4bae2f25e52858.tar.gz
mediavision-19a023602202ae8e1abbfd6dfc4bae2f25e52858.tar.bz2
mediavision-19a023602202ae8e1abbfd6dfc4bae2f25e52858.zip
mv_machine_learning: add a new feature key checking function
[Version] : 0.31.1 [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: I79ca9465bdec810029298323ea4c11e1ede36dee Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'mv_common')
-rw-r--r--mv_common/include/mv_private.h4
-rw-r--r--mv_common/src/mv_private.c79
2 files changed, 83 insertions, 0 deletions
diff --git a/mv_common/include/mv_private.h b/mv_common/include/mv_private.h
index 94c5a7ba..f7303a26 100644
--- a/mv_common/include/mv_private.h
+++ b/mv_common/include/mv_private.h
@@ -64,8 +64,12 @@ bool _mv_check_system_info_feature_supported(void);
bool _mv_barcode_detect_check_system_info_feature_supported(void);
bool _mv_barcode_generate_check_system_info_feature_supported(void);
bool _mv_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_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_roi_tracking_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;