Code Monkey home page Code Monkey logo

dcgan.caffe's Introduction

dcgan.caffe: A pure caffe-python implementation of DC-GAN

As far as I know, there is no light-weight implementation of DCGAN based on caffe.

Inspired by DeePSiM implementation, a few lines of python code can train the dcgan model quickly without any hack in caffe core lib (Dosovitskiy has already done this. However, I think the code could be merged back to master branch).

Dependency

You will need to compile the deepsim-caffe-branch. And make sure your PYTHONPATH point to it.

The deepsim-caffe only support cudnn-4.0. If disable the cudnn engine and replace some convolution layers with the master branch, a latest cudnn and cuda will work fine.

Training

For face generator, please prepare celebA dataset as the link said. Then make a train list file and put it in the data.prototxt.

Just typing

python train.py

Train file list

Each line has two columns seperated by space. The second column indicates the label of the corresponding image. Actually the label could be all zeros, since the training only need the images themselves to be the targets.

The file should look like

/data/Repo/dcgan.torch/celebA/img_align_celeba/000001.jpg 0
/data/Repo/dcgan.torch/celebA/img_align_celeba/000002.jpg 0
/data/Repo/dcgan.torch/celebA/img_align_celeba/000003.jpg 0
/data/Repo/dcgan.torch/celebA/img_align_celeba/000004.jpg 0
/data/Repo/dcgan.torch/celebA/img_align_celeba/000005.jpg 0
/data/Repo/dcgan.torch/celebA/img_align_celeba/000006.jpg 0
/data/Repo/dcgan.torch/celebA/img_align_celeba/000007.jpg 0
/data/Repo/dcgan.torch/celebA/img_align_celeba/000008.jpg 0
/data/Repo/dcgan.torch/celebA/img_align_celeba/000009.jpg 0
/data/Repo/dcgan.torch/celebA/img_align_celeba/000010.jpg 0
/data/Repo/dcgan.torch/celebA/img_align_celeba/000011.jpg 0
/data/Repo/dcgan.torch/celebA/img_align_celeba/000012.jpg 0
/data/Repo/dcgan.torch/celebA/img_align_celeba/000013.jpg 0
...

Trouble shooting

Visualization

To view the model result by

python generate.py generator.prototxt snapshots_test/4000/generator.caffemodel

The visualizations of the models at iteration 3000 and 4000 are as following:

3000

4000

dcgan.caffe's People

Contributors

samson-wang avatar

Watchers

James Cloos avatar

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.