Code to experiment with stylegan.
Expected target:
- stylegan running as a server on a GPU node,
- waiting for input images and aligning it
- backproejcting onto the latent space
- playing around with the latent direction to generate new images
python3 -m pip install git+https://github.com/jeremyfix/fakestylegan
You also need to have the dnnlib
and torch_utils
directories from the original stylegan3 repository.
Then, if you are using a GPU, you need to set the CUDA_HOME
variable appropriately :
export CUDA_HOME=/usr/local/cuda-11
and then have fun without our scripts, for example
python3 -m fakestylegan.generator
For testing the alignment code, which is the one used by NVlabs for realigning their input face image, you can :
python3 -m fakestylegan.align mysourceimage.jpg
The video faces.avi has been generated with python3 -m fakestylegan.generator
and goes around in the
latent space to illustrate its topology and the incredible power of stylegan to generate faces.
The interpolation scripts takes 30 seconds on a Geforce 3090, generating 200 images.
Interesting papers are :
R. Abdal, Y. Qin, P. Wonka (2019). Image2StyleGAN : How to embed images into the styleGAN latent space. https://arxiv.org/pdf/1904.03189.pdf