Giter Site home page Giter Site logo

change_face's Introduction

Dual Training for Face Attribute Transfer

Change photograph of a person with attributes like wearing glasses or not

Project Overview

Facial attribute transfer is an interesting task that you can get faces of a person with attributes you want. Since the aim of this task is to generate an image, researchers always use generative adversarial net (GAN) and variational autoencoder (VAE). In this work, we also apply an encoder-decoder architecture to transfer facial attribute. Instead of using GAN, we present a dual architecture as shown in figure below to keep more pure information about the person in latent representation.

Architecture The whole architecture consists of three components, which are encoder, decoder and classifier respectively.
We try to encode attribute independent information into latent representation with our encoder and generate new image of given attributes with decoder. The classifier aims to classify attributes in generated images.

In our model, we introduce dual training for better results. Note that image 1 and image 2 are from the same person. Thus they should be capable to transfer to each other. We design the dual architecture for training. Our loss includes two reconstruction errors, two classified errors and a latent differential error, which restricts the latent representations from two images of the same person to be similar.

We permute pairs of different images of one person to get the training data.
To make training efficient, we down sample the dataset to keep the target attributes of two images in a pair different.

Code Statement

All the files of filtered data from CeleA dataset are in data directory.

preprocess.py

Pre-process data to generate desired annotations.

opts.py

Experiment configuration information.

model.py

The training model we build.

celebA.py

Generate the dataset celebA .

Train_Classfier.py

Training code for the classfie.

main.py

Training code for whole network.

change_face's People

Contributors

liluxuan1997 avatar laughinggo avatar zourui89 avatar

Watchers

James Cloos avatar  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.