diff options
author | Inki Dae <inki.dae@samsung.com> | 2022-06-14 14:46:41 +0900 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2022-07-20 14:16:57 +0900 |
commit | 137fdf5b183c868fc755b8a4ff2373783cefe06d (patch) | |
tree | a5f9ab6a773c8c3410b38c3c6fd0d47bb89cbed6 | |
parent | 187aaf791c12e2e28e1a9fe80e5fb0023cce9912 (diff) | |
download | mediavision-137fdf5b183c868fc755b8a4ff2373783cefe06d.tar.gz mediavision-137fdf5b183c868fc755b8a4ff2373783cefe06d.tar.bz2 mediavision-137fdf5b183c868fc755b8a4ff2373783cefe06d.zip |
mv_machine_learning: cleanup face recognition header
[Issue type] cleanup
cleaned up face recognition header files pointed by ./check-header.py script
Change-Id: I8182c2080325bc071f9c9b9792d7c382d092503f
Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r-- | include/mv_face_recognition.h | 50 | ||||
-rw-r--r-- | include/mv_face_recognition_type.h | 24 | ||||
-rw-r--r-- | mv_machine_learning/face_recognition/src/mv_face_recognition_open.cpp | 8 |
3 files changed, 46 insertions, 36 deletions
diff --git a/include/mv_face_recognition.h b/include/mv_face_recognition.h index 0b72570d..cd761bd3 100644 --- a/include/mv_face_recognition.h +++ b/include/mv_face_recognition.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef __MEDIAVISION_FACE_RECOGNITION_H__ -#define __MEDIAVISION_FACE_RECOGNITION_H__ +#ifndef __TIZEN_MEDIAVISION_MV_FACE_RECOGNITION_H__ +#define __TIZEN_MEDIAVISION_MV_FACE_RECOGNITION_H__ #include <mv_common.h> #include <mv_face_recognition_type.h> @@ -38,15 +38,15 @@ extern "C" { * * @return @c 0 on success, otherwise a negative error value * @retval #MEDIA_VISION_ERROR_NONE Successful - * @retval #MEDIA_VISION_ERROR_OUT_OF_MEMORY Out of memory * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MEDIA_VISION_ERROR_OUT_OF_MEMORY Out of memory * * @see mv_face_recognition_destroy() */ int mv_face_recognition_create(mv_face_recognition_h *handle); /** - * @brief Destroy face recognition handle and release all its resources. + * @brief Destroys face recognition handle and release all its resources. * * @since_tizen 7.0 * @@ -63,7 +63,7 @@ int mv_face_recognition_create(mv_face_recognition_h *handle); int mv_face_recognition_destroy(mv_face_recognition_h handle); /** - * @brief Prepare the resources for face recognition. + * @brief Prepares the resources for face recognition. * @details Use this function to prepare the resources for face recognition. * * @since_tizen 7.0 @@ -73,79 +73,79 @@ int mv_face_recognition_destroy(mv_face_recognition_h handle); * @return @c 0 on success, otherwise a negative error value * @retval #MEDIA_VISION_ERROR_NONE Successful * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported - * @retval #MEDIA_VISION_ERROR_KEY_NOT_AVAILABLE Attribute key isn't available - * @retval #MEDIA_VISION_ERROR_OUT_OF_MEMORY Out of memory * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter * @retval #MEDIA_VISION_ERROR_INVALID_OPERATION Invalid operation + * @retval #MEDIA_VISION_ERROR_KEY_NOT_AVAILABLE Attribute key isn't available + * @retval #MEDIA_VISION_ERROR_OUT_OF_MEMORY Out of memory * * @pre Create face recognition handle by using mv_face_recognition_create() */ int mv_face_recognition_prepare(mv_face_recognition_h handle); /** - * @brief Register a new face on the @a source + * @brief Registers a new face on the @a source. * @details Use this function to register a new face. * Each time when this function is called, a new face on the media source * will be registered to internal database. * * @since_tizen 7.0 * - * @param [in] handle The handle to the face recognition object. - * @param [in] source The handle to the source of the media. - * @param [in] label The label to be registered. (the maximum length of the label array is 256 words) + * @param[in] handle The handle to the face recognition object. + * @param[in] source The handle to the source of the media. + * @param[in] label The label to be registered. (the maximum length of the label array is 256 words) * * @return @c 0 on success, otherwise a negative error value * @retval #MEDIA_VISION_ERROR_NONE Successful - * @retval #MEDIA_VISION_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_VISION_ERROR_INTERNAL Internal error * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter * @retval #MEDIA_VISION_ERROR_INVALID_OPERATION Invalid operation * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED_FORMAT Source colorspace * isn't supported - * + * @retval #MEDIA_VISION_ERROR_OUT_OF_MEMORY Out of memory + * @retval #MEDIA_VISION_ERROR_INTERNAL Internal error + * * @pre Prepare an face recognition by calling @ref mv_face_recognition_prepare() */ int mv_face_recognition_register(mv_face_recognition_h handle, mv_source_h source, const char *label); /** - * @brief Unregister a new face on the @a source + * @brief Unregisters face data on the @a label. * @details Use this function to unregister a given label. * Each time when this function is called, all data related to the label * will be removed from internal database. * * @since_tizen 7.0 * - * @param [in] handle The handle to the face recognition object. - * @param [in] label The label to be unregistered. (the maximum length of the label array is 256 words) + * @param[in] handle The handle to the face recognition object. + * @param[in] label The label to be unregistered. (the maximum length of the label array is 256 words) * * @return @c 0 on success, otherwise a negative error value * @retval #MEDIA_VISION_ERROR_NONE Successful - * @retval #MEDIA_VISION_ERROR_OUT_OF_MEMORY Out of memory * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter * @retval #MEDIA_VISION_ERROR_INVALID_OPERATION Invalid operation + * @retval #MEDIA_VISION_ERROR_OUT_OF_MEMORY Out of memory * * @pre Register an new face by calling @ref mv_face_recognition_register() */ int mv_face_recognition_unregister(mv_face_recognition_h handle, const char *label); /** - * @brief Inference with a given face on the @a source + * @brief Inferences with a given face on the @a source. * @details Use this function to inference with a given source. * This function returns an proper label string to a give source. * * @since_tizen 7.0 * - * @param [in] handle The handle to the face recognition object. - * @param [in] source The handle to the source of the media. - * @param [out] out_result The structure which is filled with inference result, + * @param[in] handle The handle to the face recognition object. + * @param[in] source The handle to the source of the media. + * @param[out] out_result The structure which is filled with inference result, * * @return @c 0 on success, otherwise a negative error value * @retval #MEDIA_VISION_ERROR_NONE Successful - * @retval #MEDIA_VISION_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_VISION_ERROR_INTERNAL Internal error * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter * @retval #MEDIA_VISION_ERROR_INVALID_OPERATION Invalid operation * @retval #MEDIA_VISION_ERROR_INVALID_PATH Invalid path + * @retval #MEDIA_VISION_ERROR_OUT_OF_MEMORY Out of memory + * @retval #MEDIA_VISION_ERROR_INTERNAL Internal error * @retval #MEDIA_VISION_ERROR_NO_DATA No data * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED_FORMAT Source colorspace * isn't supported @@ -160,4 +160,4 @@ int mv_face_recognition_inference(mv_face_recognition_h handle, mv_source_h sour } #endif /* __cplusplus */ -#endif /* __MEDIAVISION_FACE_RECOGNITION_H__ */ +#endif /* __TIZEN_MEDIAVISION_MV_FACE_RECOGNITION_H__ */ diff --git a/include/mv_face_recognition_type.h b/include/mv_face_recognition_type.h index c569e765..be70c754 100644 --- a/include/mv_face_recognition_type.h +++ b/include/mv_face_recognition_type.h @@ -14,13 +14,23 @@ * limitations under the License. */ -#ifndef __MEDIAVISION_FACE_RECOGNITION_TYPE_H__ -#define __MEDIAVISION_FACE_RECOGNITION_TYPE_H__ +#ifndef __TIZEN_MEDIAVISION_MV_FACE_RECOGNITION_TYPE_H__ +#define __TIZEN_MEDIAVISION_MV_FACE_RECOGNITION_TYPE_H__ #include <mv_common.h> -#define MAX_LABEL_LEN 128 -#define MAX_LABEL_CNT 100 +/** + * @brief Define MV_FACE_RECOGNITION_MAX_LABEL_LEN to indicate maximum label string length. + * + * @since_tizen 7.0 + */ +#define MV_FACE_RECOGNITION_MAX_LABEL_LEN 128 +/** + * @brief Define MV_FACE_RECOGNITION_MAX_LABEL_CNT to indicate Maximum label count. + * + * @since_tizen 7.0 + */ +#define MV_FACE_RECOGNITION_MAX_LABEL_CNT 100 #ifdef __cplusplus extern "C" { @@ -34,9 +44,9 @@ extern "C" { */ typedef struct { unsigned int label_idx; /**< label index of label file. */ - char label[MAX_LABEL_LEN]; /**< label string. */ + char label[MV_FACE_RECOGNITION_MAX_LABEL_LEN]; /**< label string. */ unsigned int raw_data_cnt; /**< raw data count which is a number of labels in label file. */ - float raw_data[MAX_LABEL_CNT]; /**< raw data to each label. */ + float raw_data[MV_FACE_RECOGNITION_MAX_LABEL_CNT]; /**< raw data to each label. */ } mv_face_recognition_result_s; /** @@ -51,4 +61,4 @@ typedef void *mv_face_recognition_h; } #endif /* __cplusplus */ -#endif /* __MEDIAVISION_FACE_RECOGNITION_TYPE_H__ */ +#endif /* __TIZEN_MEDIAVISION_MV_FACE_RECOGNITION_TYPE_H__ */ diff --git a/mv_machine_learning/face_recognition/src/mv_face_recognition_open.cpp b/mv_machine_learning/face_recognition/src/mv_face_recognition_open.cpp index f4024a3d..b4b49dae 100644 --- a/mv_machine_learning/face_recognition/src/mv_face_recognition_open.cpp +++ b/mv_machine_learning/face_recognition/src/mv_face_recognition_open.cpp @@ -202,7 +202,7 @@ int mv_face_recognition_inference_open(mv_face_recognition_h handle, mv_source_h } out_result->label_idx = out_idx; - out_result->raw_data_cnt = min(static_cast<size_t>(MAX_LABEL_CNT), out_vec.size()); + out_result->raw_data_cnt = min(static_cast<size_t>(MV_FACE_RECOGNITION_MAX_LABEL_CNT), out_vec.size()); copy_n(out_vec.begin(), out_result->raw_data_cnt, out_result->raw_data); @@ -219,11 +219,11 @@ int mv_face_recognition_inference_open(mv_face_recognition_h handle, mv_source_h return ret; } - if (result_label.length() >= MAX_LABEL_LEN - 1) - LOGW("Invalid label size. %d bytes will be filled only.", MAX_LABEL_LEN - 1); + if (result_label.length() >= MV_FACE_RECOGNITION_MAX_LABEL_LEN - 1) + LOGW("Invalid label size. %d bytes will be filled only.", MV_FACE_RECOGNITION_MAX_LABEL_LEN - 1); int length = result_label.copy(out_result->label, - min(result_label.length(), static_cast<size_t>(MAX_LABEL_LEN))); + min(result_label.length(), static_cast<size_t>(MV_FACE_RECOGNITION_MAX_LABEL_LEN))); out_result->label[length] = '\0'; LOGD("LEAVE"); |