genforce/idinvert_pytorch
소개
[ECCV 2020] In-Domain GAN Inversion for Real Image Editing (PyTorch code)
디자인 및 미디어측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalIn-Domain GAN Inversion for Real Image Editing

Figure: Real image editing using the proposed In-Domain GAN inversion with a fixed GAN generator.
In-Domain GAN Inversion for Real Image Editing
Jiapeng Zhu*, Yujun Shen*, Deli Zhao, Bolei Zhou
European Conference on Computer Vision (ECCV) 2020
[Paper] [Project Page] [Demo] [Colab]
NOTE: This repository is a simple PyTorch version of this repo, and ONLY supports inference.
Editing Tasks
Pre-trained Models
Please download the pre-trained models from the following links and save them to models/pretrain/
| Description | Generator | Encoder |
|---|---|---|
| Model trained on FFHQ dataset. | face_256x256_generator | face_256x256_encoder |
| Model trained on LSUN Tower dataset. | tower_256x256_generator | tower_256x256_encoder |
| Model trained on LSUN Bedroom dataset. | bedroom_256x256_generator | bedroom_256x256_encoder |
| Perceptual Model |
Inversion
MODEL_NAME='styleganinv_ffhq256'
IMAGE_LIST='examples/test.list'
python invert.py $MODEL_NAME $IMAGE_LIST
NOTE: We find that 100 iterations are good enough for inverting an image, which takes about 8s (on P40). But users can always use more iterations (much slower) for a more precise reconstruction.
Semantic Diffusion
MODEL_NAME='styleganinv_ffhq256'
TARGET_LIST='examples/target.list'
CONTEXT_LIST='examples/context.list'
python diffuse.py $MODEL_NAME $TARGET_LIST $CONTEXT_LIST
NOTE: The diffusion process is highly similar to image inversion. The main difference is that only the target patch is used to compute loss for masked optimization.
Interpolation
SRC_DIR='results/inversion/test'
DST_DIR='results/inversion/test'
python interpolate.py $MODEL_NAME $SRC_DIR $DST_DIR
Manipulation
IMAGE_DIR='results/inversion/test'
BOUNDARY='boundaries/expression.npy'
python manipulate.py $MODEL_NAME $IMAGE_DIR $BOUNDARY
NOTE: Boundaries are obtained using InterFaceGAN.
Style Mixing
STYLE_DIR='results/inversion/test'
CONTENT_DIR='results/inversion/test'
python mix_style.py $MODEL_NAME $STYLE_DIR $CONTENT_DIR
BibTeX
@inproceedings{zhu2020indomain,
title = {In-domain GAN Inversion for Real Image Editing},
author = {Zhu, Jiapeng and Shen, Yujun and Zhao, Deli and Zhou, Bolei},
booktitle = {Proceedings of European Conference on Computer Vision (ECCV)},
year = {2020}
}
관련 프로젝트 살펴보기
불러오는 중…