Change path of saved/loaded model data 20/54020/7 accepted/tizen/mobile/20151214.234100 accepted/tizen/tv/20151214.234117 accepted/tizen/wearable/20151214.234130 submit/tizen/20151214.225408
authorSeokHoon Lee <andy.shlee@samsung.com>
Thu, 10 Dec 2015 07:06:44 +0000 (16:06 +0900)
committerSeokHoon Lee <andy.shlee@samsung.com>
Fri, 11 Dec 2015 07:20:33 +0000 (16:20 +0900)
Signed-off-by: SeokHoon Lee <andy.shlee@samsung.com>
Change-Id: Ie7db6b92fede50dd083755b36e1e8ef5a29cff43

CMakeLists.txt
include/mv_face.h
include/mv_image.h
mv_face/face/src/FaceRecognitionModel.cpp
mv_face/face/src/FaceTrackingModel.cpp
mv_image/image/src/Recognition/ImageObject.cpp
mv_image/image/src/Tracking/ImageTrackingModel.cpp
packaging/capi-media-vision.spec

index 2ec1ac7..49c3ed3 100644 (file)
@@ -83,7 +83,7 @@ INCLUDE_DIRECTORIES(${INC_DIR}
                     ${INC_IMAGE}
                     ${INC_SURVEILLANCE})
 
-SET(dependents "dlog capi-media-tool capi-system-info capi-appfw-application")
+SET(dependents "dlog capi-media-tool capi-system-info")
 SET(pc_dependents "dlog")
 
 INCLUDE(FindPkgConfig)
index 2b6d235..e0f765b 100644 (file)
@@ -661,10 +661,12 @@ int mv_face_recognition_model_clone(
  *          This examples can be removed by
  *          @ref mv_face_recognition_model_reset() function if
  *          it is needed to clear the memory.
- * @remarks @a recognition_model is saved to the application's data directory.
+ * @remarks @a recognition_model is saved to the absolute path directory.
+ *          Use @ref app_get_data_path for the private app storage path or
+ *          @ref app_get_shared_data_path for the app shared storage path.
  *          After model is saved to the file, it can be loaded from this file
  *          by @ref mv_face_recognition_model_load() function.
- * @param [in] file_name            Name of the file to save the model
+ * @param [in] file_name            Name of the path/file to save the model
  * @param [in] recognition_model    The handle to the recognition model to be
  *                                  saved to the file
  * @return @c 0 on success, otherwise a negative error value
@@ -683,6 +685,8 @@ int mv_face_recognition_model_clone(
  *
  * @see mv_face_recognition_model_load()
  * @see mv_face_recognition_model_create()
+ * @see app_get_data_path()
+ * @see app_get_shared_data_path()
  */
 int mv_face_recognition_model_save(
         const char *file_name,
@@ -699,10 +703,12 @@ int mv_face_recognition_model_save(
  *          @ref mv_face_recognition_model_reset() function. It
  *          is recommended to clear the memory if learning algorithm doesn't
  *          support reinforcement learning.
- * @remarks @a recognition_model is loaded from the application's data directory.
+ * @remarks @a recognition_model is loaded from the absolute path directory.
+ *          Use @ref app_get_data_path for the private app storage path or
+ *          @ref app_get_shared_data_path for the app shared storage path.
  *          @a recognition_model must be destroyed using
  *          @ref mv_face_recognition_model_destroy().
- * @param [in]  file_name            Name of file to load the model
+ * @param [in]  file_name            Name of path/file to load the model
  * @param [out] recognition_model    The handle to the recognition model
  *                                   to be loaded from the file
  * @return @c 0 on success, otherwise a negative error value
@@ -719,6 +725,8 @@ int mv_face_recognition_model_save(
  *
  * @see mv_face_recognition_model_save()
  * @see mv_face_recognition_model_destroy()
+ * @see app_get_data_path()
+ * @see app_get_shared_data_path()
  */
 int mv_face_recognition_model_load(
         const char *file_name,
@@ -1033,10 +1041,12 @@ int mv_face_tracking_model_clone(
  * @brief Calls this method to save tracking model to the file.
  *
  * @since_tizen 3.0
- * @remarks @ tracking_model is saved to the application's data directory.
+ * @remarks @a tracking_model is saved to the absolute path directory.
+ *          Use @ref app_get_data_path for the private app storage path or
+ *          @ref app_get_shared_data_path for the app shared storage path.
  *          After model is saved to the file, it can be loaded from this file
  *          with @ref mv_face_tracking_model_load() function.
- * @param [in] file_name         Name of the file to save the model
+ * @param [in] file_name         Name of the path/file to save the model
  * @param [in] tracking_model    The handle to the tracking model to be
  *                               saved to the file
  * @return @c 0 on success, otherwise a negative error value
@@ -1055,6 +1065,8 @@ int mv_face_tracking_model_clone(
  *
  * @see mv_face_tracking_model_load()
  * @see mv_face_tracking_model_create()
+ * @see app_get_data_path()
+ * @see app_get_shared_data_path()
  */
 int mv_face_tracking_model_save(
         const char *file_name,
@@ -1064,10 +1076,12 @@ int mv_face_tracking_model_save(
  * @brief Calls this method to load a tracking model from file.
  *
  * @since_tizen 3.0
- * @remarks @a tracking_model is loaded from the application's data directory.
+ * @remarks @a tracking_model is loaded from the absolute path directory.
+ *          Use @ref app_get_data_path for the private app storage path or
+ *          @ref app_get_shared_data_path for the app shared storage path.
  *          @a tracking_model must be destroyed using
  *          @ref mv_face_tracking_model_destroy.
- * @param [in] file_name         Name of file to load the model
+ * @param [in] file_name         Name of path/file to load the model
  * @param [out] tracking_model   The handle to the tracking model to be
  *                               loaded from file
  * @return @c 0 on success, otherwise a negative error value
@@ -1089,6 +1103,8 @@ int mv_face_tracking_model_save(
  *
  * @see mv_face_tracking_model_save()
  * @see mv_face_tracking_model_destroy()
+ * @see app_get_data_path()
+ * @see app_get_shared_data_path()
  */
 int mv_face_tracking_model_load(
         const char *file_name,
index 5efb9b6..a1a3d34 100644 (file)
@@ -617,8 +617,10 @@ int mv_image_object_clone(
  * @brief Saves the image object.
  *
  * @since_tizen 3.0
- * @remarks @a image_object is saved to the application's data directory.
- * @param [in] file_name       Name of the file to save the image object
+ * @remarks @a image_object is saved to the absolute path directory.
+ *          Use @ref app_get_data_path for the private app storage path or
+ *          @ref app_get_shared_data_path for the app shared storage path.
+ * @param [in] file_name       Name of the file to path/save the image object
  * @param [in] image_object    The handle to the image object which will be saved
  * @return @c 0 on success, otherwise a negative error value
  * @retval #MEDIA_VISION_ERROR_NONE Successful
@@ -642,10 +644,12 @@ int mv_image_object_save(
  * @brief Loads an image object from the file.
  *
  * @since_tizen 3.0
- * @remarks @a image_object is loaded from the application's data directory.
+ * @remarks @a image_object is loaded from the absolute path directory.
+ *          Use @ref app_get_data_path for the private app storage path or
+ *          @ref app_get_shared_data_path for the app shared storage path.
  *          @a image_object must be destroyed using
  *          @ref mv_image_object_destroy().
- * @param [in]  file_name       Name of file to load the image object
+ * @param [in]  file_name       Name of path/file to load the image object
  * @param [out] image_object    The handle to the image object which will be
  *                              filled
  * @return @c 0 on success, otherwise a negative error value
@@ -799,8 +803,10 @@ int mv_image_tracking_model_clone(
  * @brief Saves the image tracking model.
  *
  * @since_tizen 3.0
- * @remarks @a image_tracking_model is saved to the application's data directory.
- * @param [in] file_name               Name of file to save the model
+ * @remarks @a image_tracking_model is saved to the absolute path directory.
+ *          Use @ref app_get_data_path for the private app storage path or
+ *          @ref app_get_shared_data_path for the app shared storage path.
+ * @param [in] file_name               Name of path/file to save the model
  * @param [in] image_tracking_model    The handle to the image tracking model
  *                                     to be saved
  * @return @c 0 on success, otherwise a negative error value
@@ -826,10 +832,12 @@ int mv_image_tracking_model_save(
  * @brief Loads an image tracking model from the file.
  *
  * @since_tizen 3.0
- * @remarks @a image_tracking_model is loaded from the application's data directory.
+ * @remarks @a image_tracking_model is loaded from the absolute path directory.
+ *          Use @ref app_get_data_path for the private app storage path or
+ *          @ref app_get_shared_data_path for the app shared storage path.
  *          @a image_tracking_model must be destroyed using
  *          @ref mv_image_tracking_model_destroy.
- * @param [in]  file_name               Name of file to load model
+ * @param [in]  file_name               Name of path/file to load model
  * @param [out] image_tracking_model    The handle to the image tracking
  *                                      model to be filled
  * @return @c 0 on success, otherwise a negative error value
index 394e067..7a42cff 100644 (file)
@@ -19,8 +19,6 @@
 #include "mv_private.h"
 #include "mv_common.h"
 
-#include <app_common.h>
-
 #include <map>
 
 #include <stdio.h>
@@ -195,11 +193,8 @@ int FaceRecognitionModel::save(const std::string& fileName)
        if (!m_recognizer.empty()) {
 
                std::string filePath;
-               char *cPath = app_get_data_path();
-               if (NULL == cPath)
-                       filePath = fileName;
-               else
-                       filePath = std::string(cPath) + fileName;
+
+               filePath = fileName;
 
                std::string prefixPath = filePath.substr(0, filePath.find_last_of('/'));
                LOGD("prefixPath: %s", prefixPath.c_str());
@@ -251,11 +246,8 @@ int FaceRecognitionModel::save(const std::string& fileName)
 int FaceRecognitionModel::load(const std::string& fileName)
 {
        std::string filePath;
-       char *cPath = app_get_data_path();
-       if (NULL == cPath)
-               filePath = fileName;
-       else
-               filePath = std::string(cPath) + fileName;
+
+       filePath = fileName;
 
        if (access(filePath.c_str(), F_OK)) {
                LOGE("Can't load face recognition model. File[%s] doesn't existed.", filePath.c_str());
index 5feeb2a..cebbb69 100644 (file)
@@ -19,8 +19,6 @@
 #include "mv_private.h"
 #include "mv_common.h"
 
-#include <app_common.h>
-
 #include <unistd.h>
 
 namespace MediaVision {
@@ -74,11 +72,8 @@ int FaceTrackingModel::save(const std::string& fileName)
        }
 
        std::string filePath;
-       char *cPath = app_get_data_path();
-       if (NULL == cPath)
-               filePath = fileName;
-       else
-               filePath = std::string(cPath) + fileName;
+
+       filePath = fileName;
 
        std::string prefixPath = filePath.substr(0, filePath.find_last_of('/'));
        LOGD("prefixPath: %s", prefixPath.c_str());
@@ -111,11 +106,8 @@ int FaceTrackingModel::save(const std::string& fileName)
 int FaceTrackingModel::load(const std::string& fileName)
 {
        std::string filePath;
-       char *cPath = app_get_data_path();
-       if (NULL == cPath)
-               filePath = fileName;
-       else
-               filePath = std::string(cPath) + fileName;
+
+       filePath = fileName;
 
        if (access(filePath.c_str(), F_OK)) {
                LOGE("Can't load face tracking model. File[%s] doesn't existed.", filePath.c_str());
index ac6569f..d9f99af 100644 (file)
@@ -25,8 +25,6 @@
 #include "mv_private.h"
 #include "mv_common.h"
 
-#include <app_common.h>
-
 #include <opencv/cv.h>
 #include <opencv2/features2d/features2d.hpp>
 
@@ -180,11 +178,8 @@ bool ImageObject::getLabel(int& label) const
 int ImageObject::save(const char *fileName) const
 {
        std::string filePath;
-       char *cPath = app_get_data_path();
-       if (NULL == cPath)
-               filePath = fileName;
-       else
-               filePath = std::string(cPath) + std::string(fileName);
+
+       filePath = fileName;
 
        std::string prefixPath = filePath.substr(0, filePath.find_last_of('/'));
        LOGD("prefixPath: %s", prefixPath.c_str());
@@ -216,11 +211,8 @@ int ImageObject::save(const char *fileName) const
 int ImageObject::load(const char *fileName)
 {
        std::string filePath;
-       char *cPath = app_get_data_path();
-       if (NULL == cPath)
-               filePath = fileName;
-       else
-               filePath = std::string(cPath) + std::string(fileName);
+
+       filePath = fileName;
 
        if (access(filePath.c_str(), F_OK)) {
                LOGE("Can't load image object model. Path[%s] doesn't existed.", filePath.c_str());
index 6240ea8..b9a89ce 100644 (file)
@@ -25,8 +25,6 @@
 #include "mv_private.h"
 #include "mv_common.h"
 
-#include <app_common.h>
-
 #include <fstream>
 #include <unistd.h>
 
@@ -223,11 +221,8 @@ ImageTrackingModel& ImageTrackingModel::operator=(const ImageTrackingModel& copy
 int ImageTrackingModel::save(const char *filepath) const
 {
        std::string filePath;
-       char *cPath = app_get_data_path();
-       if (NULL == cPath)
-               filePath = std::string(filepath);
-       else
-               filePath = std::string(cPath) + std::string(filepath);
+
+       filePath = std::string(filepath);
 
        std::string prefixPath = filePath.substr(0, filePath.find_last_of('/'));
        LOGD("prefixPath: %s", prefixPath.c_str());
@@ -258,11 +253,8 @@ int ImageTrackingModel::save(const char *filepath) const
 int ImageTrackingModel::load(const char *filepath)
 {
        std::string filePath;
-       char *cPath = app_get_data_path();
-       if (NULL == cPath)
-               filePath = std::string(filepath);
-       else
-               filePath = std::string(cPath) + std::string(filepath);
+
+       filePath = std::string(filepath);
 
        if (access(filePath.c_str(),F_OK)) {
                LOGE("Can't load tracking model. Path[%s] doesn't existed.", filepath);
index 11304f8..32d97bc 100644 (file)
@@ -1,13 +1,12 @@
 Name:        capi-media-vision
 Summary:     Media Vision library for Tizen Native API
-Version:     0.3.3
+Version:     0.3.4
 Release:     0
 Group:       Multimedia/Framework
 License:     Apache-2.0 and BSD-2.0
 Source0:     %{name}-%{version}.tar.gz
 BuildRequires: cmake
 BuildRequires: pkgconfig(capi-media-tool)
-BuildRequires: pkgconfig(capi-appfw-application)
 BuildRequires: pkgconfig(libtbm)
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(capi-system-info)