pytorch-fid icon indicating copy to clipboard operation
pytorch-fid copied to clipboard

FID sensitive to image saving

Open YutongZheng opened this issue 3 years ago • 4 comments

I found that the FID changes drastically when images are saved to the disk. Basically, it is caused by the change of pixel values when rounded from the continuous real values to 0-255 integers. Is this common in FID testing? How does everyone minimize its effect?

YutongZheng avatar Feb 26 '21 18:02 YutongZheng

I have the same issue. Now I save and load [0,1] range raw data instead of images for the evaluation, and numbers make sense to me.

AilsaF avatar May 13 '21 02:05 AilsaF

This should not be the case because generated images are often quantized to uint8 before computing the FID score. (because real images are not real values). The different in FID might be cause due to JPEG compression. The table 4 and figure 2 in this paper might be relevant to this issue. ( https://arxiv.org/pdf/2104.11222.pdf )

GaParmar avatar Aug 28 '21 17:08 GaParmar

I have the same issue. Now I save and load [0,1] range raw data instead of images for the evaluation, and numbers make sense to me.

As saving it to be image format is not okay, how to save it to be [0, 1] range raw data, something like .npz?

micklexqg avatar Oct 06 '22 12:10 micklexqg