Tensorflow implementation of the "Inception Score" (IS) for the evaluation of generative models, with a bug raised in openai/improved-gan#29 fixed.
tensorflow==1.14or (tensorflow==1.15andtensorflow-gan==1.0.0.dev0) or (tensorflow>=2andtensorflow-gan>=2.0.0)
- Fast, easy-to-use and memory-efficient, written in a way that is similar to the original implementation
- No prior knowledge about Tensorflow is necessary if your are using CPUs or GPUs
- Makes use of TF-GAN
- Downloads InceptionV1 automatically
- Compatible with both Python 2 and Python 3
- If you are working with GPUs, use
inception_score.py; if you are working with TPUs, useinception_score_tpu.pyand pass a Tensorflow Session and a TPUStrategy as additional arguments. - Call
get_inception_score(images, splits=10), whereimagesis a numpy array with values ranging from 0 to 255 and shape in the form[N, 3, HEIGHT, WIDTH]whereN,HEIGHTandWIDTHcan be arbitrary.dtypeof the images is recommended to benp.uint8to save CPU memory. - A smaller
BATCH_SIZEreduces GPU/TPU memory usage, but at the cost of a slight slowdown. - If you want to compute a general "Classifier Score" with probabilities
predsfrom another classifier, callpreds2score(preds, splits=10).predscan be a numpy array of arbitrary shape[N, num_classes].
- The Inception Score was proposed in the paper Improved Techniques for Training GANs
- Code for the Fréchet Inception Distance