GithubHelp home page GithubHelp logo

aditgupta1 / inception-score-pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sbarratt/inception-score-pytorch

0.0 1.0 0.0 10 KB

Inception Score for GANs in Pytorch

License: MIT License

Python 100.00%

inception-score-pytorch's Introduction

Inception Score Pytorch

Pytorch was lacking code to calculate the Inception Score for GANs. This repository fills this gap. However, we do not recommend using the Inception Score to evaluate generative models, see our note for why.

Getting Started

Clone the repository and navigate to it:

$ git clone [email protected]:sbarratt/inception-score-pytorch.git
$ cd inception-score-pytorch

To generate random 64x64 images and calculate the inception score, do the following:

$ python inception_score.py

The only function is inception_score. It takes a list of numpy images normalized to the range [0,1] and a set of arguments and then calculates the inception score. Please assure your images are 3x299x299 and if not (e.g. your GAN was trained on CIFAR), pass resize=True to the function to have it automatically resize using bilinear interpolation before passing the images to the inception network.

def inception_score(imgs, cuda=True, batch_size=32, resize=False, splits=1):
    """Computes the inception score of the generated images imgs
    imgs -- Torch dataset of (3xHxW) numpy images normalized in the range [-1, 1]
    cuda -- whether or not to run on GPU
    batch_size -- batch size for feeding into Inception v3
    splits -- number of splits
    """

Prerequisites

You will need torch, torchvision, numpy/scipy.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

inception-score-pytorch's People

Contributors

sbarratt avatar

Watchers

 avatar

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.