This VAE uses face-recognize network output as its perceptual Loss instead of the pixel reconstruction loss, the result examples are in pictures directory.
- Clone this repo, the code is based on tensorflow 1.12.0 and tensorflow.keras 2.1.6-tf, InstanceNormalization.py is a workaround because keras 2.1.6-tf doesn't include keras-contrib InstanceNormalization.
- Download CelebA dataset and put the files into CelebA folder.
- Download facenet keras model and put into model folder.
- Run face_vae.py to train the vae
- Use vae_attribute_manipulate.py to compute attribute vector and translate the portrait.