TwoStageVAE
TwoStageVAE copied to clipboard
pre-processing CIFAR-10
I read the discussion in OpenReview on the sensitivity of the FID score to the min-max-normalization of CIFAR-10 images.
The authors thought it was the min-max normalization carried out by imsave that changes the pixel values of images. However, I find that it is not the case.
In the reference guide of the old version of scipy (https://docs.scipy.org/doc/scipy-1.0.0/reference/generated/scipy.misc.imsave.html), there is a warning message: "This function uses bytescale under the hood to rescale images to use the full (0, 255) range if tode is one of None, 'L', 'P', 'l'. It will also cast data for 2-D images to uint32 for mode=None (which is the default)."
But bytescale() min-max normalizes the input array if the dtype of the array is not uint8. Actually, the CIFAR-10 3-D images for python have been restored as np.uint8 arrays. Thus, the min-max normalization was not executed.
It seems to be the compression of JPG format (when imsave() saving PIL.Image image object to .jpg file) that cause the changes of pixel values. See https://stackoverflow.com/questions/21949014/python-image-save-changes-the-data