Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
grohith327 committed May 27, 2020
1 parent 61868f4 commit 89ccff4
Showing 1 changed file with 49 additions and 25 deletions.
74 changes: 49 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,40 @@
**Framework to ease training of generative models**

SimpleGAN is a framework based on [TensorFlow](https://www.tensorflow.org/) to make training of generative models easier. SimpleGAN provides high level APIs with customizability options to user which allows them to train a generative models with few lines of code or the user can reuse modules from the exisiting architectures to run custom training loops and experiments.

### Requirements

Make sure you have the following packages installed
* [tensorflow](https://www.tensorflow.org/install)
* [tqdm](https://github.com/tqdm/tqdm#latest-pypi-stable-release)
* [imagio](https://pypi.org/project/imageio/)
* [opencv](https://pypi.org/project/opencv-python/)
* [tensorflow-datasets](https://www.tensorflow.org/datasets/overview#installation)

- [tensorflow](https://www.tensorflow.org/install)
- [tqdm](https://github.com/tqdm/tqdm#latest-pypi-stable-release)
- [imagio](https://pypi.org/project/imageio/)
- [opencv](https://pypi.org/project/opencv-python/)
- [tensorflow-datasets](https://www.tensorflow.org/datasets/overview#installation)

### Installation

Latest stable release:

```bash
$ pip install simplegan
```

Latest Development release:

```bash
$ pip install git+https://github.com/grohith327/simplegan.git
```

### Getting Started

##### DCGAN

```python
from simplegan.gan import DCGAN

## initialize model
gan = DCGAN()
gan = DCGAN()

## load train data
train_ds = gan.load_data(use_mnist = True)
Expand All @@ -41,7 +52,9 @@ gan.fit(train_ds = train_ds)
## get generated samples from model
generated_samples = gan.generate_samples(n_samples = 5)
```

##### Custom training loops for GANs

```python
from simplegan.gan import Pix2Pix

Expand All @@ -58,7 +71,9 @@ discriminator = gan.discriminator() ## A tf.keras model
with tf.GradientTape() as tape:
""" Custom training loops """
```

##### Convolutional Autoencoder

```python
from simplegan.autoencoder import ConvolutionalAutoencoder

Expand All @@ -78,38 +93,47 @@ autoenc.fit(train_ds = train_ds, epochs = 5, optimizer = 'RMSprop', learning_rat
## get generated test samples from model
generated_samples = autoenc.generate_samples(test_ds = test_ds.take(1))
```

To have a look at more examples in detail, check [here](examples)

### Documentation

Check out the [docs page](https://simplegan.readthedocs.io/en/latest/)

### Provided models
| Model | Generated Images |
|:---------:|:--------------:|
| Vanilla Autoencoder | None |
| Convolutional Autoencoder | ![](https://github.com/grohith327/simplegan/blob/master/assets/mnist_conv_ae.png) |
| Variational Autoencoder [[Paper](https://arxiv.org/abs/1312.6114)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/vae.jpeg) |
| Vector Quantized - Variational Autoencoder [[Paper](https://arxiv.org/abs/1711.00937)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/vq_vae.png) |
| Vanilla GAN [[Paper](https://arxiv.org/abs/1406.2661)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/GAN.png) |
| DCGAN [[Paper](https://arxiv.org/abs/1511.06434)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/DCGAN.png) |
| WGAN [[Paper](https://arxiv.org/abs/1701.07875)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/WGAN.png) |
| CGAN [[Paper](https://arxiv.org/abs/1411.1784)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/CGAN.png) |
| InfoGAN [[Paper](https://arxiv.org/abs/1606.03657)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/InfoGAN.png) |
| Pix2Pix [[Paper](https://arxiv.org/abs/1611.07004)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/Pix2Pix.png) |
| CycleGAN [[Paper](https://arxiv.org/abs/1703.10593)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/CycleGAN.png) |
| 3DGAN(VoxelGAN) [[Paper](http://3dgan.csail.mit.edu/papers/3dgan_nips.pdf)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/3DGAN.png) |
| Self-Attention GAN(SAGAN) [[Paper](https://arxiv.org/pdf/1805.08318.pdf)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/SAGAN.png) |

| Model | Generated Images |
| :------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------: |
| Vanilla Autoencoder | None |
| Convolutional Autoencoder | ![](https://github.com/grohith327/simplegan/blob/master/assets/mnist_conv_ae.png) |
| Variational Autoencoder [[Paper](https://arxiv.org/abs/1312.6114)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/vae.jpeg) |
| Vector Quantized - Variational Autoencoder [[Paper](https://arxiv.org/abs/1711.00937)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/vq_vae.png) |
| Vanilla GAN [[Paper](https://arxiv.org/abs/1406.2661)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/GAN.png) |
| DCGAN [[Paper](https://arxiv.org/abs/1511.06434)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/DCGAN.png) |
| WGAN [[Paper](https://arxiv.org/abs/1701.07875)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/WGAN.png) |
| CGAN [[Paper](https://arxiv.org/abs/1411.1784)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/CGAN.png) |
| InfoGAN [[Paper](https://arxiv.org/abs/1606.03657)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/InfoGAN.png) |
| Pix2Pix [[Paper](https://arxiv.org/abs/1611.07004)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/Pix2Pix.png) |
| CycleGAN [[Paper](https://arxiv.org/abs/1703.10593)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/CycleGAN.png) |
| 3DGAN(VoxelGAN) [[Paper](http://3dgan.csail.mit.edu/papers/3dgan_nips.pdf)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/3DGAN.png) |
| Self-Attention GAN(SAGAN) [[Paper](https://arxiv.org/pdf/1805.08318.pdf)] | ![](https://github.com/grohith327/simplegan/blob/master/assets/SAGAN.png) |

### Contributing

We appreciate all contributions. If you are planning to perform bug-fixes, add new features or models, please file an issue and discuss before making a pull request.

### Citation

```
@software{simplegan,
author = {{Rohith Gandhi et al.}},
title = {simplegan},
url = {https://simplegan.readthedocs.io},
version = {0.2.8},
version = {0.2.9},
}
```
### Contributors
* [Rohith Gandhi](https://github.com/grohith327)
* [Prem Kumar](https://github.com/Prem-kumar27)

### Contributors

- [Rohith Gandhi](https://github.com/grohith327)
- [Prem Kumar](https://github.com/Prem-kumar27)

0 comments on commit 89ccff4

Please sign in to comment.