Home

Awesome

On Self-Supervised Image Representations For GAN Evaluation

This repository is the official implementation of self-supervised FID from On Self-Supervised Image Representations For GAN Evaluation by Stanislav Morozov, Andrey Voynov and Artem Babenko.

FID is a measure of similarity between two datasets of images. It was shown to correlate well with human judgement of visual quality and is most often used to evaluate the quality of samples of Generative Adversarial Networks. Self-supervised FID is calculated by computing the Fréchet distance between two Gaussians fitted to feature representations of the SwAV Resnet50 network.

Installation

python3 setup.py install

Requirements:

Usage

To compute the self-supervised FID score between two datasets, where images of each dataset are contained in an individual folder:

python3 -m self-supervised-gan-eval path/to/dataset1 path/to/dataset2

Optionally, you can limit the number of images to calculate the FID in each dataset.

python3 -m self-supervised-gan-eval path/to/dataset1 path/to/dataset2 --max-size MAX_SIZE

To run the evaluation on GPU, use the flag --gpu N, where N is the index of the GPU to use.

Human evaluation

Human evaluation labels can be downloaded via the following links:

Precision and Recall tables have the following columns:

TopK table has the following columns:

We also release the dataset with the images used for labeling and embedding vectors (InceptionV3 and SwAV) for all images in the dataset:

Citing

If you use this repository in your research, consider citing it using the following paper:

@inproceedings{morozov2021on,
  title={On Self-Supervised Image Representations for GAN Evaluation},
  author={Morozov, Stanislav and Voynov, Andrey and Babenko, Artem},
  booktitle={International Conference on Learning Representations},
  year={2021}
}