The source code of CVPR17 'Generative Face Completion'.
Switch branches/tags
Nothing to show
Clone or download
Latest commit f72dea0 Mar 20, 2018


Matcaffe implementation of our CVPR17 paper on face completion.

In each panel from left to right: original face, masked input, completion result.


  • We use the caffe-for-cudnn-v2.5.48. Please refer Caffe for more installation details.
  • Basically, you need to first modify the MATLAB_DIR in Makefile.config and then run the following commands for a successful compilation:
make all -j4
make matcaffe


  • Follow the DCGAN to prepare the data (CelebA). The only differece is that the face we cropped is of size 128x128. Please modify Line 10 in their crop_celebA.lua file. We use the standard train&test split of the CelebA dataset.

  • Modify the training data path in ./matlab/FaceCompletion_training/GFC_caffeinit.m file.

  • Download our face parsing model Model_parsing and put it under ./matlab/FaceCompletion_training/model/ folder.

  • We provide an initial model that is only trained with the reconstruction loss, as a good start point for the subsequent GAN training. Please download it and put it under ./matlab/FaceCompletion_training/model/ folder.

  • Run ./matlab/FaceCompletion_training/demo_GFC_training.m for training.


  • Download our face completion model Model_G and put it under ./matlab/FaceCompletion_testing/model/ folder.
  • Run ./matlab/FaceCompletion_testing/demo_face128.m for completion. TestImages are from the CelebA test dataset.


    author = {Li, Yijun and Liu, Sifei and Yang, Jimei and Yang, Ming-Hsuan},
    title = {Generative Face Completion},
    booktitle = {IEEE Conference on Computer Vision and Pattern Recognition},
    year = {2017}


  • Gratitude goes to Sifei Liu for the great help on code.
  • The upsample layer (unpooling according to the pooling mask) is borrowed from the SegNet.