Converting PNG to Tensor produces different outputs in Python and Android

@ekremcet,

final Tensor inputTensor = TensorImageUtils.bitmapToFloat32Tensor(img,
                TensorImageUtils.TORCHVISION_NORM_MEAN_RGB, TensorImageUtils.TORCHVISION_NORM_STD_RGB);

Normalizes input by mean and std of ImageNet dataset that was used to train pretrained torch vision models:

public static float[] TORCHVISION_NORM_MEAN_RGB = new float[] {0.485f, 0.456f, 0.406f};
public static float[] TORCHVISION_NORM_STD_RGB = new float[] {0.229f, 0.224f, 0.225f};

Is this the right normalization for your model?

Could you share details what is the model and how big is the difference in the results?