Giter VIP home page Giter VIP logo

inception-score's Introduction

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

inception-score's People

Contributors

tsc2017 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

inception-score's Issues

CIFAR-10 results not correct.

Hi, i test CIFAR-10 50000 training images using your get_inception_score, but the results is only about 9(mean) for 1 split. Your mentioned you get the results over 11. I have check the input numpy is in the range of [0,255] and shape of [50000,3,32,32], i am not sure why. So could you provide the dataloader part to help my testing?

Is resizing images not required?

Hi @tsc2017,

I have gone through your code, and I find that you are not resizing the input images before calculating their activation scores from the InceptionNet.
I found your repo from this discussion at openai/improved-gan#29
For some reason, I am not getting correct IS value from this repo, so was looking for other codes and found this one.
Could you please let me know if the function requires resized images to size [229 x 229 x 3] is it okay to send it [32 x 32 x 3] CIFAR-10 images?

Best regards,
@akanimax

tensor to array

with your help of this code, I can put it into my model to evaluate my images generated by GANs, but the problem confused me for almost a week is the input of the code is array, but I wanna input of the function in my model is 4D tensor, and I also wanna put the result of the IS to the tensorboard, I've tried several ways like put the transference of the function in Session to transfer tensor to array as the parameters of the function (but the error is about the initialization). can u help me handle this problems ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.