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.

--scale_values and --mean_values of mo.py

timosy
New Contributor I
359 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
329 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

3 Replies
IntelSupport
Community Manager
330 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


timosy
New Contributor I
304 Views

Its nice explanation! thanks 

IntelSupport
Community Manager
296 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


Reply