Coder Social home page Coder Social logo

deconvfaces's Introduction

Generating Faces with Deconvolution Networks

Example generations

This repo contains code to train and interface with a deconvolution network adapted from this paper to generate faces using data from the Radboud Faces Database. Requires Keras, NumPy, SciPy, and tqdm with Python 3 to use.

A blog post describing this project can be found here.

Training New Models

To train a new model, simply run:

python3 faces.py train path/to/data

You can specify the number of deconvolution layers with -d to generate larger images, assuming your GPU has the memory for it. You can play with the batch size and the number of kernels per layer (using -b and -k respectively) until it fits in memory, although this may result in worse results or longer training.

Using 6 deconvolution layers with a batch size of 8 and the default number of kernels per layer, a model was trained on an Nvidia Titan X card (12 GB) to generate 512x640 images in a little over a day.

Generating Images

To generate images using a trained model, you can specify parameters in a yaml file and run:

python3 faces.py generate -m path/to/model -o output/directory -f path/to/params.yaml

There are four different modes you can use to generate images:

  • single, produce a single image.
  • random, produce a set of random images.
  • drunk, similar to random, but produces a more contiguous sequence of images.
  • interpolate, animate between a set of specified keyframes.

You can find examples of these files in the params directory, which should give you a good idea of how to format these and what's available.

Examples

Interpolating between identities and emotions:

Interpolating between identities and emotions

Interpolating between orientations: (which the model is unable to learn)

Interpolating between orientation

Random generations (using "drunk" mode):

Random generations

deconvfaces's People

Contributors

somewacko avatar welch avatar radarhere 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.