Code Monkey home page Code Monkey logo

hrfae's Introduction

HRFAE: High Resolution Face Age Editing

Official implementation for paper High Resolution Face Age Editing.

Teaser image

Dependencies

  • Python 3.7
  • Pytorch 1.1
  • Numpy
  • Opencv
  • TensorboardX
  • Tensorboard_logger

You can also create a new environment for this repo by running

conda env create -f env.yml

Load and test pretrained network

  1. You can download the pretrained model by running:

    cd ./logs/001
    ./download.sh
    
  2. Upload test images in the folder /test/input and run the test file. The output images will be saved in the folder /test/output. You can change the desired target age with --target_age.

    python test.py --config 001 --target_age 65
    

Train a new model

  1. Pretrained age classifier

    To get age information, we use an age classifier pretrained on IMDB-WIKI dataset. We use the model released from paper Deep expectation of real and apparent age from a single image without facial landmarks by Rothe et al.

    To prepare the model, you need to download the original caffe model and convert it to PyTorch format. We use the converter caffemodel2pytorch released by Vadim Kantorov. Then name the PyTorch model as dex_imdb_wiki.caffemodel.pt and put it in the folder /models.

  2. Preparing your dataset

    Download FFHQ dataset and unzip it to the /data/ffhq directory.

    Download age label to the /data directory.

    You can also train the model with your own dataset. Put your images in the /data directory. With the pretrained classifier, you can create a new label file with the age of each image.

  3. Training

    You can modify the training options of the config file in configs directory.

    python train.py --config 001 
    

Google Colab

We also provide a colab version for quick test. To run it using Google Colab, please click here.

Citation

@article{yao2020high,
    title   = {High Resolution Face Age Editing},
    author  = {Xu Yao and Gilles Puy and Alasdair Newson and Yann Gousseau and Pierre Hellier},
    journal = {CoRR},
    volume  = {abs/2005.04410},
    year    = {2020},
}

License

Copyright © 2020, InterDigital R&D France. All rights reserved.

This source code is made available under the license found in the LICENSE.txt in the root directory of this source tree.

hrfae's People

Contributors

xu-yao avatar

Watchers

 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.