资源算法inception-score-pytorch

inception-score-pytorch

2020-01-10 | |  42 |   0 |   0

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 git@github.com: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 299x299x3 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):    """Computes the inception score of the generated images imgs    imgs -- list of (HxWx3) numpy images normalized in the range [0,1]    cuda -- whether or not to run on GPU    batch_size -- batch size to feed into inception    """

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


上一篇:GoogLeNet-Inception

下一篇:DifferentialPrivacy-

用户评价
全部评价

热门资源

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • inferno-boilerplate

    This is a very basic boilerplate example for pe...