LFW G.W. Bush photos swapped using our method onto very different subjects and images.
Yuval Nirkin, Iacopo Masi, Anh Tuan Tran, Tal Hassner, and Gerard Medioni.
Code for the automatic, image-to-image face swapping method described in the paper:
Yuval Nirkin, Iacopo Masi, Anh Tuan Tran, Tal Hassner, Gerard Medioni, "On Face Segmentation, Face Swapping, and Face Perception", arXiv preprint arXiv:1704.06729, 22 Apr 2017
Please see project page for more details, more resources and updates on this project.
If you find this code useful, please make sure to cite our paper in your work.
Library | Minimum Version | Notes |
---|---|---|
Boost | 1.47 | |
OpenCV | 3.0 | |
find_face_landmarks | 1.1 | |
face_segmentation | 0.9 | |
Caffe | 1.0 | ☕️ |
Eigen | 3.0.0 | |
GLEW | 2.0.0 | |
Qt | 5.4.0 | |
HDF5 | 1.8.18 |
- Use CMake and your favorite compiler to build and install the library.
- Download the landmarks model file and extract to "data" in the installation directory.
- Download the face_seg_fcn8s.zip and extract to "data" in the installation directory.
- Download the 3dmm_cnn_resnet_101.zip and extract to "data" in the installation directory.
- Add face_swap/bin to path.
- For using the library's C++ interface, please take a look at the Doxygen generated documentation.
- Deep face segmentation, used to segment face regions in the face swapping pipeline.
- Interactive system for fast face segmentation ground truth labeling, used to produce the training set for our deep face segmentation.
- CNN3DMM, used to estimate 3D face shapes from single images.
- ResFace101, deep face recognition used in the paper to test face swapping capabilities.
Copyright 2017, Yuval Nirkin, Iacopo Masi, Anh Tuan Tran, Tal Hassner, and Gerard Medioni
The SOFTWARE provided in this page is provided "as is", without any guarantee made as to its suitability or fitness for any particular use. It may contain bugs, so use of this tool is at your own risk. We take no responsibility for any damage of any sort that may unintentionally be caused through its use.