This repository aims to perform one-shot image stylization getting the facial stylistic details right. Given a reference style image, paired real data is approximated using GAN inversion and a pretrained StyleGAN is fine-tuned using that approximate paired data. The StyleGAN is then encouraged to generalize so that the learned style can be applied to all other images.
Added support for restyle GAN inverter which performs better than the already existing e4e. This also improves the overall performance of JoJoGAN. Also created well-documented and modular Python scripts to easily pre-train and fine-tune JoJoGAN.
-
Put the target image into test_input
-
Download the required data and models using
python3 download_data.py
-
-
To use a pretrained JoJoGAN model, run
python3 pretrained_style.py
To use other pretrained styles, change the value of style here from the set of options mentioned in the comment above it -
To fine-tune a StyleGAN2 model for a custom style, run
python3 finetune_style.py
The styles need to be present in the style_images and mentioned here as a list. Note that the style must have a face in it for dlib to detect. If it fails to detect, then manually crop the style image and put into the style_images_aligned
-