Giter Site home page Giter Site logo

ingeniousfrog / geogan Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wdyin/geogan

0.0 1.0 0.0 2.67 MB

Instance Level Facial Attributes Transfer

Home Page: http://mmlab.ie.cuhk.edu.hk/projects/attribute-transfer/

Python 99.62% Shell 0.38%

geogan's Introduction

GeoGAN

codes for "Instance Level Facial Attributes Transfer with Geometry-Aware Flow".

Front Image Picture: Our model can transfer facial attributes with realistic details under high resolution.

Prerequisites

  • Pytorch 0.4

Preparing the dataset

download these datasets and put them under celeba_data:

Training

You can use different training options in options.py. Here is an example:

#!/usr/bin/env bash
job_name="goatee"
attr_name="Goatee"
    python -u train.py --n_blocks 3 --ngf 16 --ndf 64 --batch_size 24 --img_size 256\
    --sel_attrs $attr_name --name $job_name --gpu_ids 0 --use_lsgan --display_freq 50 \
    --lambda_gan_feat 5 --lambda_cls 2e-1 --print_freq 20 --lambda_flow_reg 1 --lambda_mask 1e-1

Testing

The testing consists of two phases: creating the image folder to store input images and run models on those input images. You can create your own input folders or using scripts provided below.

  • selecting inputs from celebA:

    python -u test.py --exp_folder $location_of_your_model --dataset_size 30\
     --which_epoch $num_epoch --which_iter $num_iter --attr_folder $your_input_folder \ 
     --result_folder $your_output_folder \
     --create_attr_folder --test_img_size 256
  • testing on selected inputs from celebA:

      python -u test.py --exp_folder $location_of_your_model --dataset_size 30\
     --which_epoch $num_epoch --which_iter $num_iter --attr_folder $your_input_folder \ 
     --result_folder $your_output_folder --test_img_size 256
  • selecting inputs from celebA-HQ:

    python -u test.py --exp_folder $location_of_your_model --dataset_size 30\
     --which_epoch $num_epoch --which_iter $num_iter --attr_folder $your_input_folder \ 
     --result_folder $your_output_folder \
     --create_attr_folder --is_hd --test_img_size 1024
  • testing on selected inputs from celebA:

      python -u test.py --exp_folder $location_of_your_model --dataset_size 30\
     --which_epoch $num_epoch --which_iter $num_iter --attr_folder $your_input_folder \ 
     --result_folder $your_output_folder --test_img_size 1024 --is_hd

Citation

If you use the codes, please cite the following publications:

@article{yin2019geogan,
  title={Instance Level Facial Attributes Transfer with Geometry-Aware Flow},
  author={Weidong Yin, Ziwei Liu and Chen Change Loy},
  booktitle = {AAAI Conference on Artificial Intelligence (AAAI)},
  month = {February},
  year = {2019} 
}

geogan's People

Contributors

wdyin 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.