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 131e6076431dda3f5e481f4abfe2fc884f568e92..dedc7e30807d50a21ef43de0a97293e3ddecdf10 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 3a5fef8b44ff29d21d44c8be500530655dce933b..67c7e326ccd4e3d5f16f407852f727960f98b614 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 3c0782a6469d156b02ed9742b59e5956630afecc..e32c43fd8306b4dbc7124be610fb7a5bf4db43a6 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 69a0d453f56da3418932e70fdf5ceadd17c34b57..4592f7f9b84db4608ccbb97f18dd9ed96bffdc7e 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()