mv_machine_learning: drop parsing dependency from object detection 3d
authorInki Dae <inki.dae@samsung.com>
Mon, 6 Nov 2023 07:05:46 +0000 (16:05 +0900)
committerInki Dae <inki.dae@samsung.com>
Tue, 14 Nov 2023 07:40:17 +0000 (16:40 +0900)
commit883ae2383e3167a9876e7ef1a5844d135b844ea9
treedcc1ce3450add8f2939eeb354802a21debef49a3
parent8b42d3eca68471739941284546c755731b6b4ac9
mv_machine_learning: drop parsing dependency from object detection 3d

[Issue type] : code refactoring

Drop the configuration and meta file parsing dependency from ObjectDetection3d
class.

Until now, the concrete class of each task group got the task group
configuration information from its own configuration file, and also
included a MetaParser class object to get the tensor information,
which is corresponding to a given model file.

However, these dependencies led code smell, divergent change[1] even though
the concrete class has no any dependency from parsing the configuration and
meta files - needed only information after parsed.

As a first refactoring work, this patch extracts parsing portion from
ObjectDetection3d class and introduces as a new class, ObjectDetection3dConfig
class.

With this, adapter classes of the object detection 3d task group will parse
the configuration and meta files before creating ObjectDetection3d class.
And then it will create ObjectDetection3d class with needed information.
As a result, we could manage the ObjectDetection3d class without any
dependency on parsing work.

[1] https://refactoring.guru/smells/divergent-change

Change-Id: Ia3955a841179c802437f175e783762affc258b4d
Signed-off-by: Inki Dae <inki.dae@samsung.com>
mv_machine_learning/object_detection_3d/include/mv_object_detection_3d_config.h
mv_machine_learning/object_detection_3d/include/object_detection_3d.h
mv_machine_learning/object_detection_3d/include/object_detection_3d_adapter.h
mv_machine_learning/object_detection_3d/include/object_detection_3d_config.h [new file with mode: 0644]
mv_machine_learning/object_detection_3d/include/objectron.h
mv_machine_learning/object_detection_3d/meta/object_detection_3d.json
mv_machine_learning/object_detection_3d/src/object_detection_3d.cpp
mv_machine_learning/object_detection_3d/src/object_detection_3d_adapter.cpp
mv_machine_learning/object_detection_3d/src/object_detection_3d_config.cpp [new file with mode: 0644]
mv_machine_learning/object_detection_3d/src/objectron.cpp