Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeremyfix/fakestylegan
https://github.com/jeremyfix/fakestylegan
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jeremyfix/fakestylegan
- Owner: jeremyfix
- Created: 2021-10-26T19:55:19.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-04T17:17:41.000Z (almost 2 years ago)
- Last Synced: 2023-04-27T07:40:39.679Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 1.85 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fakestylegan
Code to experiment with stylegan.
Expected target:
- [ ] stylegan running as a server on a GPU node,
- [x] waiting for input images and aligning it
- [ ] backproejcting onto the latent space
- [ ] playing around with the latent direction to generate new images## Installation
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](https://github.com/NVlabs/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
## Testing
### Alignment
For testing the alignment code, which is the one used by [NVlabs](https://github.com/NVlabs/ffhq-dataset/blob/master/download_ffhq.py) for realigning their input face image, you can :
python3 -m fakestylegan.align mysourceimage.jpg
### Interpolation in the latent space
The video [faces.avi](./examples/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.[![See stylegan3 in action](https://img.youtube.com/vi/xNXCXO3LpEI/hqdefault.jpg)](https://youtu.be/xNXCXO3LpEI)
The interpolation scripts takes 30 seconds on a Geforce 3090, generating 200 images.
## References
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