daib13 / TwoStageVAE

230 stars 33 forks source link

FID score calculation and it's difference from tf version #2

Closed saharudra closed 5 years ago

saharudra commented 5 years ago

I am trying to understand how to calculate the FID scores mentioned in the paper using the fid_score.py file. I understand that the score can be calculated using the evaluate_fid_score method, but it seems to be done for .npy files.

I want to know how much the difference will be in the fid score if I use the method in fid.py from https://github.com/bioinf-jku/TTUR as it allows to calculate the score from two folders of images?

daib13 commented 5 years ago

Hi @saharudra ,

The fid_score.py file is modified from the fid.py in https://github.com/bioinf-jku/TTUR. The purpose is to avoid saving all the images to a folder. The fid result should be the same. There is one potential issue that you might need to be careful about. When using scipy.misc.imsave to save images, it will automatically normalize the images to use the full range from 0 to 255. So in our fid_score.py we also normalize all the images to this range. I am not sure if the imsvae function in other packages will do the same normalization or if they normalize in the same way. We find that the normalization has very few impact on MNIST, Fashion-MNIST and CelebA datasets but may have a huge impact on Cifar10 dataset.

Hope this can help you. Please let me know if you have further questions.