mv_machine_learning: drop input and output type dependency from image classification
authorInki Dae <inki.dae@samsung.com>
Wed, 15 Nov 2023 10:31:30 +0000 (19:31 +0900)
committerKwanghoon Son <k.son@samsung.com>
Wed, 6 Dec 2023 01:36:46 +0000 (10:36 +0900)
commit0c6b88ab51eafb0f6283af166721a9bd5516fbf0
treec4711a6fc5dbee6a061771fb058f9e2fbf3f4a4d
parentb82026ec813de70789acee3522af365e68e2d88f
mv_machine_learning: drop input and output type dependency from image classification

[Issue type] : code refactoring

Drop input and output type dependency from image classification task group
by introducing new common input and output types, InputBaseType and
OutputBaseType, which is located in mv_machine_learning/common directory,
and by making the input and output types specific to the image
classification task group to be inherited from the common types,
and then by making adapter class of the image classification task group
to use the common type instead of specific one.

In MachineLearningType.h which is a new common header file,
struct InputBaseType {
...
};

struct OutputBaseType {
...
};

And in image_classification_type.h which is specific to image classification
task group,
struct ImageClassificationInput : public InputBaseType {
...
};

struct ImageClassificationOutput : public OutputBaseType {
...
};

With this, native API implementation - mv_image_classification.c - of the image
classification task group has no any dependency on the file so that we can
make all native implementation portions - the code in the module files starting
with 'mv_' prefix - to use common function in the mv_machine_learning/common
directory. The common function will be introduced soon.

This is a first step to drop the code duplication from the native API
implementation module of the each task group. And it's a time for second phase
since the completion of dropping the meta file dependency from the concrete
class of each task group.

Change-Id: I14764253aeafc36d4e0f39b204b35985b3ecc73a
Signed-off-by: Inki Dae <inki.dae@samsung.com>
mv_machine_learning/common/include/MachineLearningType.h [new file with mode: 0644]
mv_machine_learning/image_classification/include/image_classification_type.h
mv_machine_learning/image_classification/src/image_classification_adapter.cpp
mv_machine_learning/image_classification/src/mv_image_classification.cpp