mv_machine_learning: drop dead code
authorInki Dae <inki.dae@samsung.com>
Mon, 27 Mar 2023 08:31:54 +0000 (17:31 +0900)
committerKwanghoon Son <k.son@samsung.com>
Fri, 7 Apr 2023 08:53:23 +0000 (17:53 +0900)
[Issue type] : code cleanup

Change-Id: I79ff20ea558b23f9e0dd52cef37c473bc248ee59
Signed-off-by: Inki Dae <inki.dae@samsung.com>
mv_machine_learning/training/include/data_augment.h [deleted file]
mv_machine_learning/training/include/data_augment_default.h [deleted file]
mv_machine_learning/training/include/data_augment_flip.h [deleted file]
mv_machine_learning/training/include/data_augment_rotate.h [deleted file]
mv_machine_learning/training/src/data_augment.cpp [deleted file]
mv_machine_learning/training/src/data_augment_default.cpp [deleted file]
mv_machine_learning/training/src/data_augment_flip.cpp [deleted file]
mv_machine_learning/training/src/data_augment_rotate.cpp [deleted file]

diff --git a/mv_machine_learning/training/include/data_augment.h b/mv_machine_learning/training/include/data_augment.h
deleted file mode 100644 (file)
index 75ecd93..0000000
+++ /dev/null
@@ -1,35 +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 __DATA_AUGMENT_H__
-#define __DATA_AUGMENT_H__
-
-#include <iostream>
-#include <vector>
-
-#include <opencv2/opencv.hpp>
-#include <opencv2/imgproc/imgproc.hpp>
-
-class DataAugment
-{
-public:
-       DataAugment();
-       virtual ~DataAugment();
-
-       virtual void preprocess(std::vector<float> &in_vec, std::vector<float> &out_vec, int width, int height) = 0;
-};
-
-#endif
\ No newline at end of file
diff --git a/mv_machine_learning/training/include/data_augment_default.h b/mv_machine_learning/training/include/data_augment_default.h
deleted file mode 100644 (file)
index 7312571..0000000
+++ /dev/null
@@ -1,34 +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 __DATA_AUGMENT_DEFAULT_H__
-#define __DATA_AUGMENT_DEFAULT_H__
-
-#include <iostream>
-#include <vector>
-
-#include "data_augment.h"
-
-class DataAugmentDefault final : public DataAugment
-{
-public:
-       DataAugmentDefault();
-       ~DataAugmentDefault();
-
-       void preprocess(std::vector<float> &in_vec, std::vector<float> &out_vec, int width, int height) final;
-};
-
-#endif
\ No newline at end of file
diff --git a/mv_machine_learning/training/include/data_augment_flip.h b/mv_machine_learning/training/include/data_augment_flip.h
deleted file mode 100644 (file)
index bfe13e8..0000000
+++ /dev/null
@@ -1,34 +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 __DATA_AUGMENT_FLIP_H__
-#define __DATA_AUGMENT_FLIP_H__
-
-#include <iostream>
-#include <vector>
-
-#include "data_augment.h"
-
-class DataAugmentFlip final : public DataAugment
-{
-public:
-       DataAugmentFlip();
-       ~DataAugmentFlip();
-
-       void preprocess(std::vector<float> &in_vec, std::vector<float> &out_vec, int width, int height) final;
-};
-
-#endif
\ No newline at end of file
diff --git a/mv_machine_learning/training/include/data_augment_rotate.h b/mv_machine_learning/training/include/data_augment_rotate.h
deleted file mode 100644 (file)
index ba60d7c..0000000
+++ /dev/null
@@ -1,37 +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 __DATA_AUGMENT_ROTATE_H__
-#define __DATA_AUGMENT_ROTATE_H__
-
-#include <iostream>
-#include <vector>
-
-#include "data_augment.h"
-
-class DataAugmentRotate final : public DataAugment
-{
-private:
-       unsigned int _degree;
-
-public:
-       DataAugmentRotate(unsigned int degree = 90);
-       ~DataAugmentRotate();
-
-       void preprocess(std::vector<float> &in_vec, std::vector<float> &out_vec, int width, int height) final;
-};
-
-#endif
\ No newline at end of file
diff --git a/mv_machine_learning/training/src/data_augment.cpp b/mv_machine_learning/training/src/data_augment.cpp
deleted file mode 100644 (file)
index aa3b4f8..0000000
+++ /dev/null
@@ -1,25 +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.
- */
-
-#include "data_augment.h"
-
-using namespace std;
-
-DataAugment::DataAugment()
-{}
-
-DataAugment::~DataAugment()
-{}
\ No newline at end of file
diff --git a/mv_machine_learning/training/src/data_augment_default.cpp b/mv_machine_learning/training/src/data_augment_default.cpp
deleted file mode 100644 (file)
index cedb039..0000000
+++ /dev/null
@@ -1,32 +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.
- */
-
-#include "data_augment_default.h"
-
-using namespace std;
-
-DataAugmentDefault::DataAugmentDefault() : DataAugment()
-{}
-
-DataAugmentDefault::~DataAugmentDefault()
-{}
-
-void DataAugmentDefault::preprocess(vector<float> &in_vec, vector<float> &out_vec, int width, int height)
-{
-       cv::Mat cvSrc = cv::Mat(cv::Size(width, height), CV_32FC3, in_vec.data()).clone();
-
-       out_vec.assign((float *) cvSrc.data, (float *) cvSrc.data + cvSrc.total() * cvSrc.channels());
-}
\ No newline at end of file
diff --git a/mv_machine_learning/training/src/data_augment_flip.cpp b/mv_machine_learning/training/src/data_augment_flip.cpp
deleted file mode 100644 (file)
index f210f64..0000000
+++ /dev/null
@@ -1,36 +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.
- */
-
-#include "data_augment_flip.h"
-
-using namespace std;
-
-DataAugmentFlip::DataAugmentFlip() : DataAugment()
-{}
-
-DataAugmentFlip::~DataAugmentFlip()
-{}
-
-void DataAugmentFlip::preprocess(vector<float> &in_vec, vector<float> &out_vec, int width, int height)
-{
-       cv::Mat cvSrc = cv::Mat(cv::Size(width, height), CV_32FC3, in_vec.data()).clone();
-
-       cv::Mat cvFlip;
-
-       cv::flip(cvSrc, cvFlip, 1);
-
-       out_vec.assign((float *) cvFlip.data, (float *) cvFlip.data + cvFlip.total() * cvFlip.channels());
-}
\ No newline at end of file
diff --git a/mv_machine_learning/training/src/data_augment_rotate.cpp b/mv_machine_learning/training/src/data_augment_rotate.cpp
deleted file mode 100644 (file)
index 6ffc224..0000000
+++ /dev/null
@@ -1,54 +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.
- */
-
-#include "machine_learning_exception.h"
-#include "data_augment_rotate.h"
-
-using namespace std;
-using namespace mediavision::machine_learning::exception;
-
-DataAugmentRotate::DataAugmentRotate(unsigned int degree) : _degree(degree)
-{}
-
-DataAugmentRotate::~DataAugmentRotate()
-{}
-
-void DataAugmentRotate::preprocess(vector<float> &in_vec, vector<float> &out_vec, int width, int height)
-{
-       cv::Mat cvSrc = cv::Mat(cv::Size(width, height), CV_32FC3, in_vec.data()).clone();
-
-       cv::Mat cvRotate;
-       int rotate_code = 0;
-
-       switch (_degree) {
-       case 90:
-               rotate_code = cv::ROTATE_90_CLOCKWISE;
-               break;
-       case -90:
-       case 270:
-               rotate_code = cv::ROTATE_90_COUNTERCLOCKWISE;
-               break;
-       case 180:
-               rotate_code = cv::ROTATE_180;
-               break;
-       default:
-               throw InvalidParameter("Invalid degree value.");
-       }
-
-       cv::rotate(cvSrc, cvRotate, rotate_code);
-
-       out_vec.assign((float *) cvRotate.data, (float *) cvRotate.data + cvRotate.total() * cvRotate.channels());
-}
\ No newline at end of file