Code Monkey home page Code Monkey logo

faceattributemanipulation's Introduction

GAN Face Attribute Manipulation with Caffe Implementation

This project uses Caffe python interface to implement Face Attribute Manipulation.

Thanks to the enhanced version of py-caffe in deepsim-caffe, a few lines of python code can train GANs quickly without any hack in caffe core lib. At present this project is incomplete yet, with only GAN loss + pixel loss + residual learning are implemented.

Demo

  • Generate Eyeglasses gen
  • Remove Eyeglasses remove

Setup

You need to clone the caffe-deepsim-branch and compile py-caffe. Then replcace your caffe path in both train.py and generate.py.

Training

  • First we need to prepare the CelebA dataset since we need the annotation of face attributes. link

  • Divided the image list into two lists according to some specific attribute, e.g. Eyeglasses here. The two lists are in the following format:

    Positive.txt
    000053.jpg 0
    000093.jpg 0
    ...
    
    Negative.txt
    000001.jpg 0
    000002.jpg 0
    ...
    

    Note that the label 0 here is meaningless since we don't need them, we add labels here just for using the ImageDataLayer in Caffe. When the lists are ready you need to replace the source fileds in data_gen.prototxt and data_dual.prototxt with the prepared lists.

  • Run the training scripts

    $ python train.py

Testing

$ mkdir test_result
$ python generate.py generator.prototxt ./snapshots_test/3000/generator.caffemodel

TODO

  • Implement the perceptual loss.(I have implement a version but it seems not to work well)
  • Adding dual learning.
  • Change the network architecture to produce larger images(128x128), now the output is 64x64.

faceattributemanipulation's People

Contributors

samson-wang 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

faceattributemanipulation's Issues

the version of cudnn

when I compile the caffe, it had some errors. That seems like the version of cudnn dosn't match the caffe.So I want to know your version of cudnn. 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.