toddgit / Deep-Feature-Interporlation-Face-Attribute-manipulation-Glasses-Remove-Youth2Senior-etc.-TensorFlow

A simple implementation of the paper 'Deep Feature Interpolation for Image Content Changes'

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deep-Feature-Interporlation-Glasses-Remove-TensorFlow

A simple implementation of the paper 'Deep Feature Interpolation for Image Content Changes'

Introduction

This code is simple to read, which mainly implement the paper Deep Feature Interpolation for Image Content Changes. This method mainly address the problem of face attribute manipulation, e.g. glasses remove, change age, mouth close2open, etc.

This method is simple, but very effective. it is very similar with style transfer.

How to use

Step 1. Downloading the dataset of face, this address: Labeled Faces in the Wild(LFW). unzip it, and put it into the folder 'lfw'. Pretrained VGG19 model is needed, download it and put it into the folder 'vgg_para'.

Step 2. Excute the file 'KNN.py', which you can set the target attribute. In the final, you will obtain 100 souce images and 100 target images.

Step 3. Change the input_img's file path in 'DFI.py' and excute it

Python packages

=============================

  1. python 3.5
  2. tensorflow 1.4.0
  3. numpy
  4. scipy
  5. pillow

=============================

Results

Glasses Remove

Raw Alpha=2 Alpha=3 Alpha=4

Face attribute manipulation

Raw Senior Mustache Mouth Open Smiling Eye Close

About

A simple implementation of the paper 'Deep Feature Interpolation for Image Content Changes'

License:MIT License


Languages

Language:Python 100.0%