Skip to content

Customized Implementation of StyleGAN 2 in PyTorch which copies the lip of a generated source face onto a target face

License

Notifications You must be signed in to change notification settings

rjcculaway/stylegan2-lipcopy-pytorch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StyleGAN 2 LipCopy in PyTorch

This fork of StyleGAN 2 modifies the face's expression after generation using a predefined editing direction. It then incorporates elements from StylePortraitVideo's expression optimization process to ensure that the edited image's lip expression matches closely with the original's while maintaining the changed expression.

Requirements

This fork works with the following configuration:

  • PyTorch 1.3.1
  • CUDA 10.1/10.2

Usage

Generate Samples

python generate.py --sample N_FACES --pics N_PICS --ckpt PATH_CHECKPOINT

You should change your size (--size 256 for example) if you train with another dimension.

Generate Samples and Perform Expression Optimization

python generate_and_copy_lips.py --sample N_FACES --pics N_PICS --ckpt PATH_CHECKPOINT

You should change your size (--size 256 for example) if you train with another dimension.

Samples

Generated Image Generated Image Edited Image Edited Image Optimized Image Optimized Image

License

Model details and custom CUDA kernel codes are from official repostiories: https://github.com/NVlabs/stylegan2

Codes for Learned Perceptual Image Patch Similarity, LPIPS came from https://github.com/richzhang/PerceptualSimilarity

To match FID scores more closely to tensorflow official implementations, I have used FID Inception V3 implementations in https://github.com/mseitzer/pytorch-fid

About

Customized Implementation of StyleGAN 2 in PyTorch which copies the lip of a generated source face onto a target face

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 93.6%
  • Cuda 5.4%
  • Other 1.0%