Skip to content

This project is created to make people smile,however there are other vectors which can age or change gender of the person. You can even build and train your own model!

Notifications You must be signed in to change notification settings

erenarkangil/interactive_image_augmentation_styleGAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Face editing with Style GAN 2

Release PythonVersion License

Pycodestyle Flake8 Pydocstyle Isort PyLint

NOTE : This is work based on publishe paper found here.

Quick Start

Note: you need a Nvidia GPU to run the processing. Only editor API with pre-computed latent vectors is available with CPU.

Installation

Clone this repository and pull the models required from postprocessing via LFS:

git clone [email protected]:valentingol/gan-face-editing.git
cd gan-face-editing
git lfs pull

Then, create a new virtual environment and install all the required packages:

pip install -e .
pip install -r requirements.txt
# configs/exp/
data_dir: data/my_dataset_name

Note that if you not used the characteristics in the image, you can name the translation vectors as you want.

Important: To use the semantic segmentation mixup, the algorithm should understand the part of the face you want to modify (and the part of the image you want to preserve from the original image). To do so, you need to add a particular prefix for the translation vectors: for instance for eyes change, you need to use the prefix 'N'. For instance N_0 is a valid translation that will only edit the eyes. The table of prefix is:

Part to modify Prefix
All the face A, Ch, Se or Sk
Hair B, Hc or Hs
Nose Pn
Eyes Bn or N
Just under eyes Be
Lips Bp

If you don't use one of the prefix above, no segmentation mixup will be applied. You can use the prefix you want for custom transformations. More intuitive prefix will be available later (e.g 'eyes' for eyes, 'face' for all the face ...).

Extract other attribute directions

🚧

Retrain the GAN

To retrain the GAN you need to install horovod (Mac or Linux only).

🚧

About

This project is created to make people smile,however there are other vectors which can age or change gender of the person. You can even build and train your own model!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published