training_extensions icon indicating copy to clipboard operation
training_extensions copied to clipboard

Feature Request: Allow serialization of custom mean and std values

Open j99ca opened this issue 1 year ago • 0 comments

Currently the models' export functions use hardcoded mean and standard deviation values when generating the IR format model. I am using different values for training on my grayscale dataset and would like to have that passed along to the export function. For example, here is what the export function in MobileNetV3ForMulticlassCls looks like:

    @property
    def _exporter(self) -> OTXModelExporter:
        """Creates OTXModelExporter object that can export the model."""
        return OTXNativeModelExporter(
            task_level_export_parameters=self._export_parameters,
            input_size=(1, 3, 224, 224),
            mean=(123.675, 116.28, 103.53),
            std=(58.395, 57.12, 57.375),
            resize_mode="standard",
            pad_value=0,
            swap_rgb=False,
            via_onnx=False,
            onnx_export_configuration=None,
            output_names=["logits", "feature_vector", "saliency_map"] if self.explain_mode else None,
        )

I imagine this can work similar to the new custom input size feature

j99ca avatar Aug 09 '24 13:08 j99ca