A new Tensorflow implementation of the "Fréchet Inception Distance" (FID) between two image distributions, along with a numpy interface. The FID can be used to evaluate generative models by calculating the FID between real and fake data distributions (lower is better).
numpy
andtensorflow-gpu
- Fast and memory-efficient
- No prior knowledge about Tensorflow is necessary to use this code
- Makes use of TFGAN
- Downloads InceptionV1 automatically
- Compatibility with both Python2 and Python3
- Call
get_fid(images1, images2)
, where images1, images2 are numpy arrays with values ranging from 0 to 255 and shape in the form[N, 3, HEIGHT, WIDTH]
whereN
,HEIGHT
andWIDTH
can be arbitrary.dtype
of the images is recommended to benp.uint8
to save CPU memory. - A smaller
BATCH_SIZE
reduces GPU memory usage, but at the cost of a slight slowdown.
- The Fréchet Inception Distance was proposed in the paper GANs Trained by a Two Time-Scale Update Rule Converge to a Local Nash Equilibrium
- Code for the Inception Score