diff --git a/modelconverter/packages/rvc2/exporter.py b/modelconverter/packages/rvc2/exporter.py index a8e73eb..2bc346c 100644 --- a/modelconverter/packages/rvc2/exporter.py +++ b/modelconverter/packages/rvc2/exporter.py @@ -120,7 +120,7 @@ def _export_openvino_ir(self) -> Path: scale_values_str = "" for name, inp in self.inputs.items(): # Append mean values in a similar style - if inp.mean_values is not None: + if inp.is_color_input and inp.mean_values is not None: if mean_values_str: mean_values_str += "," mean_values_str += ( @@ -128,7 +128,7 @@ def _export_openvino_ir(self) -> Path: ) # Append scale values in a similar style - if inp.scale_values is not None: + if inp.is_color_input and inp.scale_values is not None: if scale_values_str: scale_values_str += "," scale_values_str += ( diff --git a/modelconverter/utils/config.py b/modelconverter/utils/config.py index f970cf6..e617434 100644 --- a/modelconverter/utils/config.py +++ b/modelconverter/utils/config.py @@ -141,6 +141,10 @@ class InputConfig(OutputConfig): def encoding_mismatch(self) -> bool: return self.encoding.from_ != self.encoding.to + @property + def is_color_input(self) -> bool: + return self.encoding.from_ in {Encoding.RGB, Encoding.BGR} + @model_validator(mode="after") def _validate_grayscale_inputs(self) -> Self: if self.layout is None: