# GeneGAN: Learning Object Transfiguration and Attribute Subspace from Unpaired Data
By Shuchang Zhou, Taihong Xiao, Yi Yang, Dieqiao Feng, Qinyao He, Weiran He
If you use this code for your research, please cite our paper:
```
@inproceedings{DBLP:conf/bmvc/ZhouXYFHH17,
author = {Shuchang Zhou and
Taihong Xiao and
Yi Yang and
Dieqiao Feng and
Qinyao He and
Weiran He},
title = {GeneGAN: Learning Object Transfiguration and Attribute Subspace from Unpaired Data},
booktitle = {Proceedings of the British Machine Vision Conference (BMVC)},
year = {2017},
url = {http://arxiv.org/abs/1705.04932},
timestamp = {http://dblp.uni-trier.de/rec/bib/journals/corr/ZhouXYFHH17},
bibsource = {dblp computer science bibliography, http://dblp.org}
}
```
### Introduction
This is the official source code for the paper [GeneGAN: Learning Object Transfiguration
and Attribute Subspace from Unpaired Data](https://arxiv.org/abs/1705.04932). All the experiments are initially done in
our proprietary deep learning framework. For convenience, we reproduce the results using TensorFlow.
<div align="center">
<img align="center" src="images/cross.jpg" width="450" alt="cross">
</div>
<br/>
GeneGAN is a deterministic conditional generative model that can learn to disentangle the object
features from other factors in feature space from weak supervised 0/1 labeling of training data.
It allows fine-grained control of generated images on a certain attribute in a continous way.
### Requirement
- Python 3.5
- TensorFlow 1.0
- Opencv 3.2
### Training GeneGAN on celebA dataset
0. Download [celebA](http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html) dataset and unzip it into
`datasets` directory. There are various source providers for CelebA datasets. To ensure that the
size of downloaded images is correct, please run `identify datasets/celebA/data/000001.jpg`. The
size should be 409 x 687 if you are using the same dataset. Besides, please ensure that you have
the following directory tree structure.
```
├── datasets
│ └── celebA
│ ├── data
│ ├── list_attr_celeba.txt
│ └── list_landmarks_celeba.txt
```
1. Run `python preprocess.py`. It will take several miniutes to preprocess all face images.
A new directory `datasets/celebA/align_5p` will be created.
2. Run `python train.py -a Bangs -g 0` to train GeneGAN on the attribute `Bangs`.
You can train GeneGAN on other attributes as well. All available attribute names are
listed in the `list_attr_celeba.txt` file.
3. Run `tensorboard --logdir='./' --port 6006` to watch your training process.
### Testing
We provide three kinds of mode for test. Run `python test.py -h` for detailed help.
The following example is running on our GeneGAN model trained on the attribute
`Bangs`. Have fun!
#### 1. Swapping of Attributes
You can easily add the bangs of one person to another person without bangs by running
python test.py -m swap -i datasets/celebA/align_5p/182929.jpg -t datasets/celebA/align_5p/022344.jpg
<div align="center">
<img align="center" src="images/182929_resize.jpg" alt="input">
<img align="center" src="images/022344_resize.jpg" alt="target">
<img align="center" src="images/swap_out1.jpg" alt="out1">
<img align="center" src="images/swap_out2.jpg" alt="out2">
</div>
<div align="center">
Swap Attribute
</div>
<br/>
#### 2. Linear Interpolation of Image Attributes
Besides, we can control to which extent the bangs style is added to your input image
through linear interpolation of image attribute. Run the following code.
python test.py -m interpolation -i datasets/celebA/align_5p/182929.jpg -t datasets/celebA/align_5p/035460.jpg -n 5
<div align="center">
<img align="center" src="images/interpolation.jpg" alt="interpolation">
<img align="center" src="images/035460_resize.jpg" alt="target">
</div>
<div align="center">
Linear Interpolation
</div>
<br/>
#### 3. Matrix Interpolation in Attribute Subspace
We can do something cooler. Given four images with bangs attributes at hand,
we can observe the gradual change process of our input images with a mixing of
difference bangs style.
python test.py -m matrix -i datasets/celebA/align_5p/182929.jpg --targets datasets/celebA/align_5p/035460.jpg datasets/celebA/align_5p/035451.jpg datasets/celebA/align_5p/035463.jpg datasets/celebA/align_5p/035474.jpg -s 5 5
<div align="center">
<img align="center" src="images/four_matrix.jpg" alt="matrix">
</div>
<div align="center">
Matrix Interpolation
</div>
<br/>
没有合适的资源?快使用搜索试试~ 我知道了~
GeneGAN.zip_92gan.com_genegan_genegan是什么_人脸生成_属性人脸生成
共60个文件
sample:11个
jpg:8个
py:6个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 78 浏览量
2022-09-21
00:12:54
上传
评论
收藏 992KB ZIP 举报
温馨提示
可以生成特定属性的人脸图片,用于人脸属性编辑
资源推荐
资源详情
资源评论
收起资源包目录
GeneGAN.zip (60个子文件)
GeneGAN
split_by_attribute.py 3KB
images
022344_resize.jpg 1KB
182929_resize.jpg 2KB
four_matrix.jpg 27KB
swap_out1.jpg 2KB
interpolation.jpg 6KB
swap_out2.jpg 1KB
035460_resize.jpg 3KB
cross.jpg 35KB
test.py 9KB
train.py 5KB
.git
index 1KB
hooks
fsmonitor-watchman.sample 3KB
pre-push.sample 1KB
prepare-commit-msg.sample 1KB
applypatch-msg.sample 478B
pre-commit.sample 2KB
pre-receive.sample 544B
pre-applypatch.sample 424B
commit-msg.sample 896B
pre-rebase.sample 5KB
update.sample 4KB
post-update.sample 189B
config 399B
description 73B
refs
tags
heads
master 41B
GeneGan-by-Doctor-Fish 41B
remotes
origin
HEAD 32B
GeneGan-by-Doctor-Fish 41B
logs
refs
heads
master 188B
GeneGan-by-Doctor-Fish 655B
remotes
origin
HEAD 188B
GeneGan-by-Doctor-Fish 148B
HEAD 847B
packed-refs 198B
objects
7f
02dce94c622bfc4a08597e85b55d9557ba3099 816B
ec
2eae6206b646b71edd21a5167677e03481262e 2KB
71
7ff857a7807ba7b9cbd79827fe1d50bc67e9a9 309B
92
aea15293c4cbe504b9cc053061c8de2fb46b35 162B
c7
ea04034ab1229a9ca3d84d6f6af0d2127a7905 161B
info
47
440007df994432782a4b542ebe6993c69eb2a3 2KB
ad
6abd08596cc7921bb50067d88952f7059cc773 164B
pack
pack-26e79a0a6d140044552ed183844cfc306995b2ce.idx 6KB
pack-26e79a0a6d140044552ed183844cfc306995b2ce.pack 858KB
7d
db81301e3eed3cfe62ba95de9ffcb24eb4e88e 2KB
31
081add412e42f38778e2db8f8564c31781aee6 352B
b4
7ca19930ca6144fd822449f8e1e9da75838534 353B
info
exclude 240B
COMMIT_EDITMSG 16B
HEAD 39B
dataset.py 6KB
LICENSE 35KB
.idea
vcs.xml 180B
modules.xml 266B
workspace.xml 13KB
GeneGAN.iml 455B
inspectionProfiles
preprocess.py 19KB
model.py 10KB
.gitignore 67B
README.md 5KB
共 60 条
- 1
资源评论
APei
- 粉丝: 64
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功