Skip to content

vvvin333/face_edit

Repository files navigation

Face_editting

Experiments with face editting along axis in latent space with StyleGAN — I reconstructed stylegan`s work from several repositories for generated and real images, combine them, tried to find pitch_boundary(for pitch-axis) from several photos with my 'by-eye' scores. Added scripts for generating faces of persons that do not exist and interpolating with params in latent space.

Sample

pose (yaw) Teaser image

Requirements:

Python 3.7 pytorch 1.1.0 TensorFlow 1.15.0 sklearn 0.21.2 I used conda (channels: conda-forge pytorch) for the packages:
tqdm
numpy
pillow
tensorflow==1.15.0
tensorflow-gpu
keras
dlib
opencv
imutils
torch

Python notebook:

https://colab.research.google.com/drive/1LoQtE8UJfICMa4_bCernbjCcC784P2kw?usp=sharing

Instructions:

  1. download pre-trained stylegan_ffhq-generator model, pre-trained stylegan_celebahq-generator model, or pre-trained pggan_celebahq-generator model, to the models/pretrain folder.
  2. generate faces of persons (1-4 batch!) that do not exist:
python generate_photo.py --num_samples=4 --noise_seed=1 --resolution=1024
  1. edit faces in latent space with params (one can change each parameter in params.json within (-3, 3)):
python manipulate_photo_with_params.py --latent_file='latents/sample_base.npy' --params_file='params.json' --resolution=1024
  1. generate linear interpolations in latent space with bound parameters from params.json
python linear_interpolations.py --latent_file='latents/sample_base.npy' --params_file='params.json' --num_steps=6  --resolution=1024 --show_interpolations=False

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages