Coder Social home page Coder Social logo

hairstyle_transfer_api's Introduction

Hairstyle Transfer between Face Images (FG 2021)

Hairstyle Transfer

We propose a neural network which takes two inputs, a hair image and a face image, and produces an output image having the hair of the hair image seamlessly merged with the inner face of the face image. Our architecture consists of neural networks mapping the input images into a latent code of a pretrained StyleGAN2 which generates the output high-definition image. We propose an algorithm for training parameters of the architecture solely from synthetic images generated by the StyleGAN2 itself without the need of any annotations or external dataset of hairstyle images. We empirically demonstrate the effectiveness of our method in applications including hair-style transfer, hair generation for 3D morphable models, and hair-style interpolation. Fidelity of the generated images is verified by a user study and by a novel hairstyle metric proposed in the paper.

Hairstyle Transfer between Face Images (FG 2021)
Adéla Šubrtová, Jan Čech, Vojtěch Franc

Paper, Project page, Demo

Installation

Clone this repository.

git clone https://github.com/subrtade662/hairstyle_transfer.git
cd hairstyle_transfer

Install dependencies

pip install -r requirements.txt

Download required models:

Inference

Hairstyle Transfer

python inference.py --output_path /path/to/save/the/results/ \
--mode transfer \
--source /path/to/img1.jpg \
--target /path/to/img2.png \
[--alpha_blend]

Interpolation

python inference.py --output_path /path/to/save/the/results/ \
--mode interp \
--source /path/to/img1.jpg \
--target /path/to/img2.png  \
--nsteps 10 \
[--interpolate_face] \
[--alpha_blend]

Manipulation

python inference.py --output_path /path/to/save/the/results/ \
--mode manip \
--source /path/to/img1.jpg  \
--attribute color/structure \
--strength 10,10.5,11. \
[--alpha_blend]

Acknowledgements

Source code builds upon the work of Richardson et al. pixel2style2pixel.

Citation

If you find this useful, please, cite our paper.

@INPROCEEDINGS{9667038,
  author={Šubrtová, Adéla and Čech, Jan and Franc, Vojtěch},
  booktitle={2021 16th IEEE International Conference on Automatic Face and Gesture Recognition (FG 2021)}, 
  title={Hairstyle Transfer between Face Images}, 
  year={2021},
  volume={},
  number={},
  pages={1-8},
  doi={10.1109/FG52635.2021.9667038}}

hairstyle_transfer_api's People

Contributors

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