Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 2.37 KB

README.md

File metadata and controls

29 lines (23 loc) · 2.37 KB

Inception Score

Tensorflow implementation of the "Inception Score" (IS) for the evaluation of generative models, with a bug raised in openai/improved-gan#29 fixed.

Major Dependencies

  • tensorflow==1.14 or (tensorflow==1.15 and tensorflow-gan==1.0.0.dev0) or (tensorflow>=2 and tensorflow-gan>=2.0.0)

Features

  • 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

Usage

  • If you are working with GPUs, use inception_score.py; if you are working with TPUs, use inception_score_tpu.py and pass a Tensorflow Session and a TPUStrategy as additional arguments.
  • Call get_inception_score(images, splits=10), where images is a numpy array with values ranging from 0 to 255 and shape in the form [N, 3, HEIGHT, WIDTH] where N, HEIGHT and WIDTH can be arbitrary. dtype of the images is recommended to be np.uint8 to save CPU memory.
  • A smaller BATCH_SIZE reduces GPU/TPU memory usage, but at the cost of a slight slowdown.
  • If you want to compute a general "Classifier Score" with probabilities preds from another classifier, call preds2score(preds, splits=10). preds can be a numpy array of arbitrary shape [N, num_classes].

Examples

GPU: Example In Colab

TPU and TF1: Example In Colab

TPU and TF2: Example In Colab

Links