mv_machine_learning: drop parsing dependency from object detection
authorVibhav Aggarwal <v.aggarwal@samsung.com>
Mon, 6 Nov 2023 09:59:32 +0000 (18:59 +0900)
committerInki Dae <inki.dae@samsung.com>
Tue, 14 Nov 2023 07:39:56 +0000 (16:39 +0900)
commit1b62c3b6ea158257250886793b98e9f689a544d2
treebe863edb97195c358d3d762f50983c11819414dc
parent38d71ecfb0db3a160bb50ec2e9dbbcb67243be74
mv_machine_learning: drop parsing dependency from object detection

[Issue type] : code refactoring

Drop the configuration and meta file parsing dependency from ObjectDetection
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
ObjectDetection class and introduces as a new class, ObjectDetectionConfig
class.

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

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

Change-Id: I526d58e0012ba4daae8eb6eb7ef99bb3cf8545d6
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
15 files changed:
mv_machine_learning/object_detection/include/face_detection_adapter.h
mv_machine_learning/object_detection/include/iobject_detection.h
mv_machine_learning/object_detection/include/mobilenet_v1_ssd.h
mv_machine_learning/object_detection/include/mobilenet_v2_ssd.h
mv_machine_learning/object_detection/include/object_detection.h
mv_machine_learning/object_detection/include/object_detection_adapter.h
mv_machine_learning/object_detection/include/object_detection_config.h [new file with mode: 0644]
mv_machine_learning/object_detection/include/object_detection_external.h
mv_machine_learning/object_detection/src/face_detection_adapter.cpp
mv_machine_learning/object_detection/src/mobilenet_v1_ssd.cpp
mv_machine_learning/object_detection/src/mobilenet_v2_ssd.cpp
mv_machine_learning/object_detection/src/object_detection.cpp
mv_machine_learning/object_detection/src/object_detection_adapter.cpp
mv_machine_learning/object_detection/src/object_detection_config.cpp [new file with mode: 0644]
mv_machine_learning/object_detection/src/object_detection_external.cpp