Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sbarratt/inception-score-pytorch
Inception Score for GANs in Pytorch
https://github.com/sbarratt/inception-score-pytorch
Last synced: 3 months ago
JSON representation
Inception Score for GANs in Pytorch
- Host: GitHub
- URL: https://github.com/sbarratt/inception-score-pytorch
- Owner: sbarratt
- License: mit
- Created: 2017-11-06T23:35:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-03T21:10:27.000Z (over 4 years ago)
- Last Synced: 2024-01-18T20:24:32.277Z (5 months ago)
- Language: Python
- Homepage:
- Size: 9.77 KB
- Stars: 603
- Watchers: 11
- Forks: 122
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Lists
- awesome-t2i-eval - PyTorch - score-pytorch?style=social&label=Star)](https://github.com/sbarratt/inception-score-pytorch) (Metrics)
README
# 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](https://arxiv.org/abs/1801.01973) 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.
```python
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](http://pytorch.org/), [torchvision](https://github.com/pytorch/vision), [numpy/scipy](https://scipy.org/).
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
## Acknowledgments
* Inception Score from [Improved Techniques for Training GANs](https://arxiv.org/abs/1606.03498)