
圖1:使用使用我們的方法發現的控件執行的圖像編輯序列,應用於三種不同的gan。白色插圖使用第3.4節中解釋的符號('Layer-Wise-Wise編輯')指定了特定的編輯。
甘斯空間:發現可解釋的甘恩控件
ErikHärkönen1,2 ,Aaron Hertzmann 2 ,Jaakko Lehtinen 1,3 ,Sylvain Paris 2
1 Aalto University, 2 Adobe Research, 3 Nvidia
https://arxiv.org/abs/2004.02546摘要:本文介紹了一種簡單的技術,可以分析生成對抗網絡(GAN)並為圖像合成創建可解釋的控件,例如觀點的改變,老化,照明和一天中的時間。我們基於在激活空間中應用的主成分分析(PCA)確定重要的潛在方向。然後,我們表明可以根據這些編輯說明的層應用來定義可解釋的編輯。此外,我們表明Biggan可以以類似於樣式的方式通過層次輸入來控制。用戶可以通過這些機制確定大量可解釋的控件。我們證明了來自各個數據集的gan的結果。
視頻: https://youtu.be/jdticda_eai
請參閱設置說明。
該存儲庫包括Biggan,stylegan和stylegan2的版本,以支持每層潛在向量。
交互式模型探索
# Explore BigGAN-deep husky
python interactive.py --model=BigGAN-512 --class=husky --layer=generator.gen_z -n=1_000_000
# Explore StyleGAN2 ffhq in W space
python interactive.py --model=StyleGAN2 --class=ffhq --layer=style --use_w -n=1_000_000 -b=10_000
# Explore StyleGAN2 cars in Z space
python interactive.py --model=StyleGAN2 --class=car --layer=style -n=1_000_000 -b=10_000
# Apply previously saved edits interactively
python interactive.py --model=StyleGAN2 --class=ffhq --layer=style --use_w --inputs=out/directions
可視化主組件
# Visualize StyleGAN2 ffhq W principal components
python visualize.py --model=StyleGAN2 --class=ffhq --use_w --layer=style -b=10_000
# Create videos of StyleGAN wikiart components (saved to ./out)
python visualize.py --model=StyleGAN --class=wikiart --use_w --layer=g_mapping -b=10_000 --batch --video
選項
Command line paramaters:
--model one of [ProGAN, BigGAN-512, BigGAN-256, BigGAN-128, StyleGAN, StyleGAN2]
--class class name; leave empty to list options
--layer layer at which to perform PCA; leave empty to list options
--use_w treat W as the main latent space (StyleGAN / StyleGAN2)
--inputs load previously exported edits from directory
--sigma number of stdevs to use in visualize.py
-n number of PCA samples
-b override automatic minibatch size detection
-c number of components to keep
主論文中介紹的所有數字均可使用隨附的Jupyter筆記本重新創建:
figure_teaser.ipynbfigure_pca_illustration.ipynbfigure_pca_cleanup.ipynbfigure_style_content_sep.ipynbfigure_supervised_comp.ipynbfigure_biggan_style_resampling.ipynbfigure_edit_zoo.ipynb BaseModel接口在models/wrappers.py中為模型創建包裝器。models/wrappers.py中的get_model() 。 可以將經過訓練的stylegan和stylegan2權重從TensorFlow導入到甘斯空間中。
conda install tensorflow-gpu=1.* 。__init__() , models/wrappers.py中的load_model() class stylegan。checkpoints/stylegan2/<dataset>_<resolution>.pt 。__init__() ,class stylegan2下的models/wrappers.py中的download_checkpoint() 。 我們要感謝:
@inproceedings{härkönen2020ganspace,
title = {GANSpace: Discovering Interpretable GAN Controls},
author = {Erik Härkönen and Aaron Hertzmann and Jaakko Lehtinen and Sylvain Paris},
booktitle = {Proc. NeurIPS},
year = {2020}
}
該存儲庫的代碼在Apache 2.0許可證下發布。
目錄netdissect是GAN解剖項目的衍生產品,並根據MIT許可提供。
Directories models/biggan和models/stylegan2根據MIT許可提供。