mv_machine_learning: code refactoring to meta file approach
authorInki Dae <inki.dae@samsung.com>
Mon, 17 Oct 2022 09:00:46 +0000 (18:00 +0900)
committerInki Dae <inki.dae@samsung.com>
Mon, 7 Nov 2022 03:12:39 +0000 (12:12 +0900)
commit6a55665b7e3dcb4fcb2fe7ceba0eae6dfc6f1b08
tree68d1de2f813eaa874c5958a97f9f2a6ebd623d3b
parentba229d55747f39d8c9bf9fc7f1206d4b7d97243f
mv_machine_learning: code refactoring to meta file approach

[Issue type] code refactoring

Did code refactoring to meta file approach by doing,
- Change existing meta file format with more generic way.
  With this change, we can describe all input and output tensors of models.
  Existing meta file didn't describe output tensor information but only
  decoding way, and it made the use of multiple tensor descriptions
  with their pre/post process ways not possible because tensor and
  pre/post process information was handled separetely.
  So we don't need to thinking of them separetely because each tensor
  can or can't include pre/post process task according to a given model
  file and even there are many combinations of them.
- Introduce MetadataType.h header file which includes meta file approach
  common types.
    - Introduce LabelInfo.h/cpp, NumberInfo.h/cpp.

The main purpose of this refactoring applies the enhanced meta file format,

Before
======

{
"inputmetadata" :
{
"tensor_info" : [
{
"name" : "xxx",
...
}
]
"preprocess" : [
{
"normalization" : [
{
...
}
]
...
}
]
}
"outputmetadata" :
{
"box" :
{
"name" : "tensor1_name",
..
},
"score" :
{
"name" : "tensor2_name",
},
...
}
}

[After]
=======

{
"input" : [
{
"tensor1" : {
"name" : "xxx",
...
"preprocess" : {
"normalization" : {
...
}
}
}
...
}
]

"output" : [
{
"tensor1" : {
"name" : "tensor1_name",
...
"postprocess" : {
"box" : {
...
}
}
},
"tensor2" : {
"name" : "tensor2_name",
...
"postprocess" : {
"score" : {
...
}
}
}
...
}
]
}

Change-Id: I9d9be615dc3dd972d506b807030c745d8a0916a9
Signed-off-by: Inki Dae <inki.dae@samsung.com>
21 files changed:
mv_machine_learning/inference/include/BoxInfo.h
mv_machine_learning/inference/include/DecodeInfo.h
mv_machine_learning/inference/include/DispVec.h
mv_machine_learning/inference/include/InputMetadata.h
mv_machine_learning/inference/include/LabelInfo.h [new file with mode: 0644]
mv_machine_learning/inference/include/Landmark.h
mv_machine_learning/inference/include/MetadataType.h [moved from mv_machine_learning/inference/include/OutputMetadataTypes.h with 64% similarity]
mv_machine_learning/inference/include/NumberInfo.h [new file with mode: 0644]
mv_machine_learning/inference/include/OffsetVec.h
mv_machine_learning/inference/include/OutputMetadata.h
mv_machine_learning/inference/include/ScoreInfo.h
mv_machine_learning/inference/src/BoxInfo.cpp
mv_machine_learning/inference/src/Inference.cpp
mv_machine_learning/inference/src/InputMetadata.cpp
mv_machine_learning/inference/src/LabelInfo.cpp [new file with mode: 0644]
mv_machine_learning/inference/src/Metadata.cpp
mv_machine_learning/inference/src/NumberInfo.cpp [new file with mode: 0644]
mv_machine_learning/inference/src/ObjectDecoder.cpp
mv_machine_learning/inference/src/OutputMetadata.cpp
mv_machine_learning/inference/src/PoseDecoder.cpp
mv_machine_learning/inference/src/ScoreInfo.cpp