Code Monkey home page Code Monkey logo

dcgan-tensorflow-slim's Introduction

DCGAN in tensorflow-slim

Implementation of DCGAN with TensorFlow slim. Base codes and models are from DCGAN in Tensorflow made by Taehoon Kim. At this time, this code only support Flower dataset, but maybe with some tweaks you can train/evaluate in other dataset.

I know there are lots of code of DCGAN, especially made by Taehoon Kim. However, this code implement DCGAN with the bleeding edges features of TensorFlow such as TF-Slim, tf.train.Supervisor and TFRecords etc.

Requirements

  • TensorFlow 1.0
  • SciPy
  • NumPy
  • wget (Python library)
  • Only tested in Python 3.4

Basic usages

Before train model, we have to convert dataset into TFRecords file format. To do that, first download Flower dataset and then convert (also you can use other dataset such as MNIST or CIFAR-10).

$ cd dataset
# for flower dataset
$ python download_and_convert.py flowers
# for celebA dataset
$ python download_and_convert.py celebA
# if you want to use other dataset, you might change provided code.

Above instructions will make flowers.tfrecords or celeba.tfrecords file in dataset directory.

To train model,

$ python3 dcgan/train.py

See dcgan/train.py and dcgan/config.py to modify arguments like logdir or batch_size etc (Someday I will provide argument parse codes).

Test (or sample) with trained model using below code.

$ python3 dcgan/sample.py

Note that checkpoint files must be located in logdir directory. See dcgan/train.py and dcgan/config.py. By default, logdir is set to log/ directory.

Results

Below examples are randomly selected from model with trained around 60k steps.

flower_result1 flower_result2

Some flowers looks fine, but most of images are bad. I believe that this is because Flower dataset has lots of noises, however on the other side, DCGAN's capacity doesn't enough to handle noisy images.

Plot in TensorBoard

Oops.. I accidentally deleted TensorBoard log file. :(

TODO

  1. Provide pre-trained model
  2. Apply argparse in train.py and sample.py
  3. TODOs

dcgan-tensorflow-slim's People

Contributors

nmhkahn 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.