sbarratt/inception-score-pytorch
sbarratt/inception-score-pytorch has 663 GitHub stars and 122 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-15 23:26 UTC. Last push 2020-03-03.
Measured star growth
- in 24h
- 0
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
About
Inception Score for GANs in Pytorch
Machine LearningREADME.md
OriginalInception 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 from Improved Techniques for Training GANs