mv_machine_learning: drop dead code
authorInki Dae <inki.dae@samsung.com>
Tue, 14 Feb 2023 02:25:15 +0000 (11:25 +0900)
committerKwanghoon Son <k.son@samsung.com>
Fri, 3 Mar 2023 08:11:58 +0000 (17:11 +0900)
[Issue type] : code cleanup

Change-Id: If8ad0145e30b95776d891477fcebf72afd5150eb
Signed-off-by: Inki Dae <inki.dae@samsung.com>
mv_machine_learning/face_recognition/include/backbone_model_info.h [deleted file]
mv_machine_learning/face_recognition/include/face_recognition.h
mv_machine_learning/face_recognition/src/face_recognition.cpp

diff --git a/mv_machine_learning/face_recognition/include/backbone_model_info.h b/mv_machine_learning/face_recognition/include/backbone_model_info.h
deleted file mode 100644 (file)
index 5deb576..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Copyright (c) 2022 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.
- */
-
-#ifndef __BACKBONE_MODEL_INFO_H__
-#define __BACKBONE_MODEL_INFO_H__
-
-#include "inference_engine_common_impl.h"
-
-typedef struct {
-       std::string layer_name;
-       inference_engine_tensor_info tensor_info;
-} model_layer_info;
-
-class IBackboneModelInfo
-{
-public:
-       virtual ~IBackboneModelInfo()
-       {}
-
-       virtual std::vector<model_layer_info> &getInputLayerInfo() = 0;
-       virtual std::vector<model_layer_info> &getOutputLayerInfo() = 0;
-       virtual std::string getModelFilePath() = 0;
-};
-
-#endif
\ No newline at end of file
index 5647e5b323091b017a06360bd2bc4d70be5fafea..6afb72805125080885d6f731b7133f2a0d1784ee 100644 (file)
@@ -26,7 +26,6 @@
 #include "inference_engine_common_impl.h"
 #include "Inference.h"
 #include "label_manager.h"
-#include "backbone_model_info.h"
 #include "feature_vector_manager.h"
 #include "data_set_manager.h"
 #include "simple_shot.h"
@@ -91,7 +90,6 @@ private:
        unsigned int _status;
        std::unique_ptr<mediavision::inference::Inference> _internal;
        std::unique_ptr<mediavision::inference::Inference> _backbone;
-       std::unique_ptr<IBackboneModelInfo> _backbone_model_info;
        std::unique_ptr<TrainingModel> _training_model;
        std::unique_ptr<LabelManager> _label_manager;
        FaceRecognitionConfig _config;
@@ -102,8 +100,6 @@ private:
        void checkFeatureVectorFile(std::string fv_file_name, std::string new_fv_file_name);
        void storeDataSet(std::unique_ptr<DataSetManager> &data_set, unsigned int label_cnt);
        int getAnswer();
-       std::vector<model_layer_info> &getBackboneInputLayerInfo();
-       int getVecFromMvSource(mv_source_h img_src, std::vector<float> &out_vec);
 
 public:
        FaceRecognition();
index 427b2219308bef72a3f8d38458a54d84529f9ac5..d7c1c5e54c5efddb5f52897f653b4ea44dfec8f1 100644 (file)
@@ -45,14 +45,7 @@ namespace mediavision
 namespace machine_learning
 {
 FaceRecognition::FaceRecognition()
-               : _status(NONE)
-               , _internal()
-               , _backbone()
-               , _backbone_model_info()
-               , _training_model()
-               , _label_manager()
-               , _config()
-               , _result()
+               : _status(NONE), _internal(), _backbone(), _training_model(), _label_manager(), _config(), _result()
 {}
 
 FaceRecognition::~FaceRecognition()
@@ -121,42 +114,6 @@ void FaceRecognition::setConfig(FaceRecognitionConfig &config)
        _config = config;
 }
 
-std::vector<model_layer_info> &FaceRecognition::getBackboneInputLayerInfo()
-{
-       return _backbone_model_info->getInputLayerInfo();
-}
-
-int FaceRecognition::getVecFromMvSource(mv_source_h img_src, std::vector<float> &out_vec)
-{
-       mv_colorspace_e colorspace = MEDIA_VISION_COLORSPACE_INVALID;
-       unsigned int width = 0, height = 0, bufferSize = 0;
-       unsigned char *buffer = NULL;
-
-       if (mv_source_get_width(img_src, &width) != MEDIA_VISION_ERROR_NONE ||
-               mv_source_get_height(img_src, &height) != MEDIA_VISION_ERROR_NONE ||
-               mv_source_get_colorspace(img_src, &colorspace) != MEDIA_VISION_ERROR_NONE ||
-               mv_source_get_buffer(img_src, &buffer, &bufferSize))
-               return MEDIA_VISION_ERROR_INVALID_PARAMETER;
-
-       // TODO. Let's support various color spaces.
-
-       if (colorspace != MEDIA_VISION_COLORSPACE_RGB888) {
-               LOGE("Not Supported format!\n");
-               return MEDIA_VISION_ERROR_NOT_SUPPORTED_FORMAT;
-       }
-
-       vector<model_layer_info> &input_layer_info = getBackboneInputLayerInfo();
-       // TODO. consider multiple tensor info.
-       size_t re_width = input_layer_info[0].tensor_info.shape[0];
-       size_t re_height = input_layer_info[0].tensor_info.shape[1];
-
-       LOGD("Convert mv source(WxH) : %d x %d => %zu x %zu", width, height, re_width, re_height);
-
-       FeatureVectorManager::getVecFromRGB(buffer, out_vec, width, height, re_width, re_height);
-
-       return MEDIA_VISION_ERROR_NONE;
-}
-
 int FaceRecognition::initialize()
 {
        _training_model = make_unique<SimpleShot>(_config.training_engine_backend_type, _config.training_target_device_type,