diff --git a/modelconverter/__main__.py b/modelconverter/__main__.py index b416023..6c19919 100644 --- a/modelconverter/__main__.py +++ b/modelconverter/__main__.py @@ -215,7 +215,7 @@ def extract_preprocessing( encoding = inp.encoding layout = inp.layout - dai_type = encoding.from_.value + dai_type = encoding.to.value if dai_type != "NONE": if inp.data_type == DataType.FLOAT16: type = "F16F16F16" @@ -227,7 +227,7 @@ def extract_preprocessing( preproc_block = PreprocessingBlock( mean=mean, scale=scale, - reverse_channels=encoding.from_ != encoding.to, + reverse_channels=encoding.to == Encoding.RGB, interleaved_to_planar=layout == "NHWC", dai_type=dai_type, ) diff --git a/modelconverter/utils/nn_archive.py b/modelconverter/utils/nn_archive.py index 8a85161..19812f3 100644 --- a/modelconverter/utils/nn_archive.py +++ b/modelconverter/utils/nn_archive.py @@ -18,7 +18,7 @@ from modelconverter.utils.constants import MISC_DIR from modelconverter.utils.layout import guess_new_layout, make_default_layout from modelconverter.utils.metadata import get_metadata -from modelconverter.utils.types import DataType +from modelconverter.utils.types import DataType, Encoding logger = logging.getLogger(__name__) @@ -235,7 +235,7 @@ def modelconverter_config_to_nn( if inp.scale_values else None ), - "reverse_channels": inp.encoding.from_ != inp.encoding.to, + "reverse_channels": inp.encoding.to == Encoding.RGB, "interleaved_to_planar": layout == "NHWC", "dai_type": dai_type, },