Unofficial implementation of DragGAN with StyleGAN2/3 pretrained models
This repo is mainly to re-implement DragGAN based on stylegan2/3
Trying out the Web Demo for dragging your own image:
- Linux or macOS
- NVIDIA GPU CUDA CuDNN
- Python 3
- Clone the repository:
git clone https://github.com/MingtaoGuo/DragGAN_stylegan3.git
cd DragGAN_stylegan3
- Dependencies:
We recommend running this repository using Anaconda or Docker. All dependencies for defining the environment are provided inenvironment.yaml
andDockerfile
.
Downloading the stylegan2 pretrained models:
- stylegan2-ffhq-512x512.pt
- stylegan2-afhqwild-512x512.pt
- stylegan2-afhqdog-512x512.pt
- stylegan2-afhqcat-512x512.pt
- stylegan2-human-1024x1024.pt
Drag generated image:
python draggan_stylegan2.py
Drag generated human image:
python draggan_stylegan2_human.py
Drag real image:
python draggan_stylegan2_realimg.py
In the draggan_stylegan2.py
, src_points (red point in image)
will be dragged to the tar_points (blue point in image)
, so just revise the points in src_points
and tar_points
.
FFHQ1 | FFHQ2 |
---|---|
Human1 | Human2 |
---|---|
AFHQ1 | AFHQ2 |
---|---|
AFHQ_Cat1 | AFHQ_Cat2 |
---|---|
AFHQ_Dog1 | AFHQ_Dog2 |
---|---|
Real image | Projected image | Drag Result |
---|---|---|
Mingtao Guo E-mail: gmt798714378 at hotmail dot com
stylegan3 stylegan-human cutout team
[1]. Pan, Xingang, et al. "Drag Your GAN: Interactive Point-based Manipulation on the Generative Image Manifold." arXiv preprint arXiv:2305.10973 (2023).