Class-Aware Frechet Distance (CAFD) for GANs in Tensorflow. Source code for "An Improved Evaluation Framework for Generative Adversarial Networks" [pdf].
- python >= 3.5.0
- Tensorflow >= 1.4.0
You can manually download the domain-specific encoder and assign its path in cafd.py
.
- mnist.pb [GoogleDrive]
- fashion-mnist.pb [GoogleDrive]
Precalculated features for CAFD calculation are made available.
- mnist.csv [GoogleDrive]
- fashion-mnist.csv [GoogleDrive]
Different GAN models should be compared under the same encoder.
To use CAFD, you can download the .pb model and assign its paths in cafd.py
. Then, you can use
python cafd.py input1 input2
The input can be the path of either a folder containing generated images or a precalculated .csv features.
You may use the precalculated features to test your model (take mnist for example):
python cafd.py mnist.csv path-to-your-folder
The folder contains the images generated by your GAN model.
-
The folder
celebA
contains the code for Fig. 3 in the paper. -
The folder
mnist
contains the code for Fig. 5 in the paper.
If you find this code useful in your research, please cite:
@article{cafd2018,
title = {An Improved Evaluation Framework for Generative Adversarial Networks},
author = {Liu, Shaohui and Wei, Yi and Lu, Jiwen and Zhou, Jie},
Journal = {arXiv preprint arXiv:1803.07474},
year = {2018},
}
The first two authors share equal contributions.