Change Info class to struct 63/281263/1 sandbox/inki.dae/object_detection_3d
authorKwanghoon Son <k.son@samsung.com>
Thu, 15 Sep 2022 05:08:26 +0000 (01:08 -0400)
committerKwanghoon Son <k.son@samsung.com>
Thu, 15 Sep 2022 05:08:26 +0000 (01:08 -0400)
[Issue type] refactoring

ObjectDecoder class needs access all of Info member variables.
So all of Info class variables need to get method because it is
just struct of data. Since Info classes not have any special
member function, struct is more suitable for data access.

Change-Id: Ifa470fbb17344451584e0b93ad6faf859c021eba
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
mv_machine_learning/inference/include/BoxInfo.h
mv_machine_learning/inference/include/DecodeInfo.h
mv_machine_learning/inference/include/DimInfo.h
mv_machine_learning/inference/include/ScoreInfo.h

index 131e607..dedc7e3 100644 (file)
@@ -48,9 +48,8 @@ struct Number
        DimInfo dimInfo;
 };
 
-class BoxInfo
+struct BoxInfo
 {
-private:
        std::vector<std::string> names;
        DimInfo dimInfo;
        inference_box_type_e type = INFERENCE_BOX_TYPE_ORIGIN_LEFTTOP; // 0:L-T-R-B, 1: Cx-Cy-W-H
@@ -75,7 +74,6 @@ private:
                { "YOLO_ANCHOR", INFERENCE_BOX_DECODING_TYPE_YOLO_ANCHOR }
        };
 
-public:
        ~BoxInfo() = default;
 
        std::string GetName();
index 3a5fef8..67c7e32 100644 (file)
@@ -101,9 +101,8 @@ struct RoiOptionParam
        int mode;
 };
 
-class DecodeInfo
+struct DecodeInfo
 {
-private:
        AnchorParam anchorParam;
        std::vector<cv::Rect2f> anchorBoxes;
        CellParam cellParam;
@@ -111,7 +110,6 @@ private:
        RotateParam rotParam;
        RoiOptionParam roiOptParam;
 
-public:
        DecodeInfo()
        {
                cellParam.type = INFERENCE_SCORE_TYPE_NORMAL;
index 3c0782a..e32c43f 100644 (file)
@@ -24,12 +24,10 @@ namespace mediavision
 {
 namespace inference
 {
-class DimInfo
+struct DimInfo
 {
-private:
        std::vector<int> dims;
 
-public:
        std::vector<int> GetValidIndexAll() const
        {
                LOGI("ENTER");
index 69a0d45..4592f7f 100644 (file)
@@ -41,9 +41,8 @@ struct DeQuantization
        {}
 };
 
-class ScoreInfo
+struct ScoreInfo
 {
-private:
        std::vector<std::string> names;
        DimInfo dimInfo;
        double threshold = 0.0;
@@ -52,8 +51,6 @@ private:
        std::shared_ptr<DeQuantization> deQuantization;
        std::map<std::string, inference_score_type_e> supportedScoreTypes = { { "NORMAL", INFERENCE_SCORE_TYPE_NORMAL },
                                                                                                                                                  { "SIGMOID", INFERENCE_SCORE_TYPE_SIGMOID } };
-
-public:
        ~ScoreInfo() = default;
 
        std::string GetName()