- arXiv: SinGAN: Learning a Generative Model from a Single Natural Image
- Supplementary Material
- Offiicial implementation: tamarott/SinGAN
Swift for TensorFlow and some python dependencies are required.
It's not trainable with latest release v0.6.0 due to its AD bug. Use development snapshot.
I recommend this Dockerfile:
https://github.com/t-ae/s4tf-docker
$ swift run -c release SinGAN Input/ballons.png
TensorBoard log will be generated under logdir
.
$ tensorboard --logdir logdir/
Original | SR |
---|---|
More examples in Results directory.
Original implementation uses batch norm. I afraid it's problematic.
SinGAN is trained with single image. It means batch size is always 1.
Therefore batch norm works like instance norm while training.
But when it comes to inference phase, batch norm uses running stats of training phase. It can be much different from training phase.
To avoid this, I simply replaced batch norm with instance norm.
As I wrote in the issue, original implementation of gradient penalty looks wrong.
Anyway S4TF doesn't support higher-order differentiaion for now. So I decided not to use WGAN-GP.
Since I didn't use WGAN-GP, I need other techniques to stabilize training.
I employed spectral normalization and use hinge loss.