Code Monkey home page Code Monkey logo

ganotebooks's Introduction

Generative Adversarial Notebooks

Collection of my Generative Adversarial Network implementations

Most codes are for python3, most notebooks works on

CycleGAN

  • CycleGAN-lasagne
  • CycleGAN-keras

CycleGAN results

Result after 3 hours and 58 epochs on a GTX 1080. From top to bottom: Input, Fake, Recreate of the input.

Face-off result. From top to bottom: Input, Fake, Recreate of the input. [youtube video](https://www.youtube.com/watch?v=Fea4kZq0oFQ)

pix2pix

  • pix2pix-keras: pix2pix GAN Keras implementation
  • pix2pix-lasagne: pix2pix GAN Lasagne implementation
  • pix2pix-torch: pix2pix GAN pytorch implementation

pix2pix sample results

Validation result of edges-to-shoes after 12 epochs. From top to bottom: Input, Ground truth, the result.

Validation result of facades dataset after 150 epochs using resnet. From top to bottom: Input, Ground truth, the result.

WGAN on CIFAR10

WGAN2 (improved WGAN/WGAN-gp)

  • wgan2-lasagne: improved WGAN Lasagne implementation (on CIFAR10)
  • wgan2-keras: improved WGAN Keras implementation (on CIFAR10)
  • wgan2-lasagne-anime: WGAN on anime face images, lasagne
  • wgan2-AC-lasagne: improved WGAN Lasagne implementation with Auxillary classfier

WGAN2 sample results

  • cifar10 dataset

  • cifar10 dataset with Auxillary classfier

  • anime face dataset

InfoGAN

  • mnist-infogan: InfoGAN Lasagne on MNIST dataset
  • mnist-infogan-paper-uniform: InfoGAN Lasagne on MNIST dataset (fllowing the paper implementation)

InfoGAN sample results

DCGAN

  • dcgan-lasagne: DCGAN in Lasagne

DCGAN sample results

ganotebooks's People

Contributors

tjwei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ganotebooks's Issues

KeyError: 'module name can\'t contain "."'

Hi, @tjwei when I execute the wgan2-AC-lasagne.ipynb in your repository, the following error appears:

KeyError Traceback (most recent call last)
in
----> 1 netG = DCGAN_G_nobn(imageSize, nz, nc, ngf, 1, n_extra_layers)
2 netG.apply(weights_init)

in init(self, isize, nz, nc, ngf, ngpu, n_extra_layers)
59 main = nn.Sequential()
60 main.add_module('initial.{0}-{1}.convt'.format(nz, cngf),
---> 61 nn.ConvTranspose2d(nz, cngf, 4, 1, 0, bias=False))
62 main.add_module('initial.{0}.relu'.format(cngf),
63 nn.ReLU(True))

/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py in add_module(self, name, module)
184 raise KeyError("attribute '{}' already exists".format(name))
185 elif '.' in name:
--> 186 raise KeyError("module name can't contain "."")
187 elif name == '':
188 raise KeyError("module name can't be empty string """)

KeyError: 'module name can't contain "."'

How can I solve this problom? Thanks a lot.

model_cycle_fber.npz No such file or directory

Hi I have tried compiling the CycleGAN-lasagne-fber.ipynb file and in the end it complains about No such file or directory. here is the full information on the error.

/home/ubuntu/GANotebooks/CycleGAN-lasagne-fber.ipynb in ()
----> 1 with np.load('model_cycle_fber.npz') as f:
2 param_values = [f['arr_%d' % i] for i in range(len(f.files))]
3 lasagne.layers.set_all_param_values([netDA, netDB, netGA, netGB], param_values)

/home/ubuntu/anaconda3/lib/python3.5/site-packages/numpy/lib/npyio.py in load(file, mmap_mode, allow_pickle, fix_imports, encoding)
368 own_fid = False
369 if isinstance(file, basestring):
--> 370 fid = open(file, "rb")
371 own_fid = True
372 elif is_pathlib_path(file):

FileNotFoundError: [Errno 2] No such file or directory: 'model_cycle_fber.npz'

save weight of pix2pix-keras

Hi tjwei,
Thank for your wonderful code. could you please tell me how to save weight of that pix2pix-keras jupyter notebook after finish training? Thank you in advance.

help in pix2pix-keras

hello . i have got problem in pix2pix-keras

i dont know what shall i download your structers dataset
could you get me direct link to this dataset.
i know this link http://cmp.felk.cvut.cz/~tylecr1/facade/ or http://vision.cs.utexas.edu/projects/finegrained/utzap50k/
but i dont know how prepare this dataset

data = "edges2shoes"
data = "facades"
direction = 0
trainAB = load_data('pix2pix/{}/train/.jpg'.format(data))
valAB = load_data('pix2pix/{}/val/
.jpg'.format(data))
assert len(trainAB) and len(valAB)

Hi tjwei!

Hey tjwei!

Ive implemented your cycle GAN today for an application at ours. After a couple bugs its working and it seems to be doing a great job!

I wanted to thank you for your work and also tell you that we would love to invite you to join our startup Recogni! We are looking for people with exactly your skills!

Please find and add me on linkedin gilles backhus if youre interest.

Have a good day dude!

Regards,
Gilles

Face-off dataset

I would like to know which dataset you used for the face-off application.
How would I train videos for a face off purpose.
I am working on ubuntu 16.04

优化器的weights怎么保存

wgan-gp keras中每次加载模型后,优化器好像又被初始化了,我要怎样才能保存优化器的weights?

loss function for D in wgan2-keras.py

Hi

I think the loss function in wgan2-keras should be

loss = loss_fake - loss_real + nz * λ * grad_penalty

in your In[9]

Because you called the loss_mixed = K.mean(netD(netD_mixed_input)) before, which divide nz, so you should make up here.

Am I right?

How to get started?

Hi, I am new to this. Could anyone please tell me how should I get started if I want to train a new model using a source and destination video?

Change of Keras API

When I run pix2pix-keras.ipynb, in the fifth block

if K._BACKEND == 'theano':

raises

AttributeError: module 'keras.backend' has no attribute '_BACKEND'

In the current Keras version (2.2.5), the proper API has changed to K.backend().
Would you please fix that, or should I draft a PR?

Besides, consider that the repo is created 2-3 years ago, there may be a lot of such API change and will be troublesome to fix them all. Would it be helpful to add a requirements.txt stating all the proper version of used packages, to avoiding such problems?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.