Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6493 Discussions

--scale_values and --mean_values of mo.py

timosy
New Contributor I
1,216 Views

When I quantize a model (and also train a model), I used scaling 

      

g_normalize = torchvision.transforms.Normalize(
      mean=[0.5029, 0.4375, 0.3465],
      std=[0.2818, 0.2659, 0.2629]

)
train_dataset = torchvision.datasets.ImageFolder(
      "/datasetA/train/",
      torchvision.transforms.Compose([
            torchvision.transforms.RandomResizedCrop(224), 
            torchvision.transforms.RandomHorizontalFlip(), 
            torchvision.transforms.ToTensor(),
            g_normalize
]))

 

In this case, do I also have to use the same values with "--scale_values" and "--mean_values" option when I convert the model to IR. or, it's not necessary to add these options?

0 Kudos
1 Solution
IntelSupport
Community Manager
1,186 Views

Hi Hep77to,

 

Thanks for reaching out.

 

It is not necessary if the input pre-processing operations are part of the model. In this case, the application will not pre-process the input data as a separate step and it will be embedded into the model itself. You can find more details in When to Specify Mean and Scale Values.

 

 

Regards,

Aznie


View solution in original post

0 Kudos
3 Replies
IntelSupport
Community Manager
1,187 Views

Hi Hep77to,

 

Thanks for reaching out.

 

It is not necessary if the input pre-processing operations are part of the model. In this case, the application will not pre-process the input data as a separate step and it will be embedded into the model itself. You can find more details in When to Specify Mean and Scale Values.

 

 

Regards,

Aznie


0 Kudos
timosy
New Contributor I
1,161 Views

Its nice explanation! thanks 

0 Kudos
IntelSupport
Community Manager
1,153 Views

Hi hep77to,


This thread will no longer be monitored since this issue has been resolved. If you need any additional information from Intel, please submit a new question. 



Regards,

Aznie


0 Kudos
Reply