StyleGAN workshop Dangerzones
Setup Remote Jupyterhub Notebook
1. Signing into Jupyterhub via keycloak
key in your keycloak credentials here
Choose an XS slice
make sure to choose cuda 11.7 from the dropdown
2. Installing Stylegan3
conda init bashsource ~/.bashrcgit clone https://github.com/NVlabs/stylegan3.gitcd stylegan3conda env create -f environment.ymlconda activate stylegan3conda install cudatoolkitdownloading models
make 'pretrained' directory
mkdir pretrainedffhq flicker faces
wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/j06LuPxYHRRtnQE/download -O pretrained/ffhq_faces.pklWikiart
wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/tbjJS7XBezbAC3B/download -O pretrained/wikiart.pklMetfaces
wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/eFZAmR6dDLelSo7/download -O pretrained/metfaces.pkl
Setup Local Stylegan
1. Refer to the Github Page
For major installation process refer to the stylegan3 GitHub Page.
This is an in-depth YouTube tutorial on how to install stylegan3 locally
2. Installing Stylegan3
conda init bashsource ~/.bashrcgit clone https://github.com/NVlabs/stylegan3.gitcd stylegan3conda env create -f environment.ymlconda activate stylegan3conda install cudatoolkitdownloading models
make 'pretrained' directory
mkdir pretrainedffhq flicker faces
wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/j06LuPxYHRRtnQE/download -O pretrained/ffhq_faces.pklWikiart
wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/tbjJS7XBezbAC3B/download -O pretrained/wikiart.pklMetfaces
wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/eFZAmR6dDLelSo7/download -O pretrained/metfaces.pklInference
For generating single images and videos, you may follow these steps.
activating conda environment
this needs to be done before every session if you want to use stylegan
conda init bashsource ~/.bashrcconda activate stylegan3inference images
python gen_images.py --outdir=out --trunc=1 --seeds=2 --network=https://api.ngc.nvidia.com/v2/models/nvidia/research/stylegan3/versions/1/files/stylegan3-r-afhqv2-512x512.pklinference video
python gen_video.py --output=out/wikiart.mp4 --trunc=1 --seeds=0-31 --network=pretrained/wikiart.pklTraining
For training your own datasets, you can follow these steps.
Dowload Training data
mkdir trainingdataGroup 01
wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/7SzJ55ZroKPf5zY/download -O trainingdata/group01.zipGroup 02
wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/7SzJ55ZroKPf5zY/download -O trainingdata/group02.zipGroup 03
wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/YGR7BaeoIBSePNl/download -O trainingdata/group03.zipGroup 04
wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/SsrPKyPcyswd8z2/download -O trainingdata/group04.zipGroup 05
wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/b1I0rgEaPcyaP44/download -O trainingdata/group05Group 06
wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/Orv9FDqqKwtBMlB/download -O trainingdata/group06Prepare training data
python dataset_tool.py --source=trainingdata/group01.zip --destination=trainingdata/group01 --resolution=512x512start training
python train.py --helpDownloading the DangerzonesGANs
downloading dangerzones models
go into directory pretrained:
cd pretrainedDownload our trained models from the KISD Modelzoo:
Group 01 - androids gynoids
wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/B7rOZIRzPN5rev1/download -O pretrained/group_01_220.pklGroup 02 TBF - dataset error
Group 03 - grayscale faces
wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/SRcjw6DPv9AIacn/download -O pretrained/group_03_500.pklGroup 04 -future cities
wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/CW8uQ2dsQbVOiXa/download -O pretrained/group_04_20.pklGroup 05 - lamppost and sunflowers
wget --no-check-certificate --content-disposition https://th-koeln.sciebo.de/s/fb0skqUV9ypIOEl/download -O pretrained/group_05.pklGroup 05 - encoded data





No Comments