TigistAbebaw sorry I didn't explain that I also altered part of visualize() codes in utils.py such that the generated txt file would be used for visualization. Please take following steps:
- Run
generate_samples(), which will create a sample_file.txt. - Run
DCGAN.main()in test mode and make sureoption=0forvisualize(). - Select images by hand from generated png file that you need for arithmetic calculation (take smiling woman for example), and copy corresponding sample vector (examplar vector) in sample_file.txt to a new txt file.
- Repeat 1-3 until you have 3 different examplar vectors (smiling woman, normal woman and normal man). Name this new txt file as exemplar_vector.txt.
- Run
alrithmetic_sample()which performs arithmetic calculation between 3 examplar vectors and generates a new sample_file.txt. - Run
DCGAN.main()in test mode and setoption=0invisualize(). Now arithmetic result image will be generated.
Pardon me if the procedures are far more complicated than a single script file. But I believe it introduces more freedom in the process.
https://github.com/johnhany/DCGAN-tensorflow
本文介绍了一种使用DCGAN进行面部属性编辑的方法,通过修改样本向量实现特定属性的算术运算,如将微笑女性的特征转移到普通男性脸上。过程包括生成样本文件、手动选择图片及对应的向量、进行向量运算并最终生成带有新属性的人脸图像。
1万+

被折叠的 条评论
为什么被折叠?



