Skip to content

Creates a face mask of a given image and applies it to the faces in a capture device feed

License

Notifications You must be signed in to change notification settings

Serphyus/Dlib-Face-Swap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dlib-Face-Swap

This project is an AI project that uses dlib for face detection and shape prediction and some geometric triangulation and transformation for warping a face mask on top of it. The detector discovers faces in a live feed provided from a chosen capture device. For each face discovered in the live feed the program uses the landmark predictor model to create a set of face landmark coordinates. These then get used to calculate a dealunay triangulation. The same process happens on the image given as the face mask and for each frame the triangulations of the face mask are warped to the shape of the face triangulations in the live feed using an affine transformation and then rendered on top of them.

FaceMask Demo

Pip Requirements

  • opencv-python
  • numpy
  • dlib
  • Pillow
  • windows-capture-device-list

Setup

clone the main repo and install requirements

git clone https://github.com/Serphyus/Dlib-Face-Swap.git
cd Dlib-Face-Swap
pip install requirements.txt

Usage

run the main python file

python src/main.py

About

Creates a face mask of a given image and applies it to the faces in a capture device feed

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages