Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 1.06 KB

README.md

File metadata and controls

23 lines (15 loc) · 1.06 KB

This is the code behind the Switching Eds blog post.

See the link for an explanation of the code.

To run the script you'll need to install dlib (http://dlib.net) including its Python bindings, and OpenCV. You'll also need to obtain the trained model from sourceforge.

install dlib

download page: http://dlib.net/compile.html download link: http://dlib.net/files/dlib-19.16.tar.bz2

download face_landmarks.dat

http://sourceforge.net/projects/dclib/files/dlib/v18.10/shape_predictor_68_face_landmarks.dat.bz2

Unzip with bunzip2 and change PREDICTOR_PATH to refer to this file. The script is run like so:

./faceswap.py <head image> <face image>

If successful, a file output.jpg will be produced with the facial features from <head image> replaced with the facial features from <face image>.