mseitzer / pytorch-fid

Compute FID scores with PyTorch.
Apache License 2.0
3.33k stars 505 forks source link

transforms: ToTensor(), Normalization #112

Open kmittle opened 3 months ago

kmittle commented 3 months ago

The InceptionV3 model in PyTorch is trained on ImageNet. According to the official documentation, it uses the mean and standard deviation of ImageNet for normalization. However, I noticed in the code that the normalization method used is just ToTensor(). Wouldn't it be more appropriate to normalize using the mean and standard deviation of ImageNet?

image https://pytorch.org/vision/stable/models/generated/torchvision.models.inception_v3.html

kmittle commented 3 months ago

Correction: I found that the way to normalize is to normalize to -1 to 1. However, this does not seem to make as much sense as using ImageNet's mean-variance normalization.