altunenes / Part-Whole

Swap facial landmarks(or whole facial area) for the part-whole task with OpenCV + dlib and MediaPipe.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CodeFactor

Update for Media Pipe

Since dlib library is getting older, I edited main code and apply with the Media Pipe library. It's faster than dlib but I don't think it giving better results. I added faces that are processed with media pipe, so try both; and use the best result :)

Slayt1

Part-Whole

Swap facial landmarks for the part-whole task

The part-whole task is a well-known task among face researchers especially studying face processing. It has been developed by (Tanaka & Farah, 1993) https://doi.org/10.1080/14640749308401045.

This script provides you a realistic results with seamlessClone function.

In order to get clear results, use high-quality images as much as possible. But if you have low-quality faces you probably need to use some extra filter methods to edges (Gaussian is working well in most scenarios).

Referance for the trained detector: https://github.com/codeniko/shape_predictor_81_face_landmarks

Example for facial parts:

New Microsoft PowerPoint Presentation

(the leftmost is nose+mouth) TEST

testttt

Faces from: https://thispersondoesnotexist.com/

About

Swap facial landmarks(or whole facial area) for the part-whole task with OpenCV + dlib and MediaPipe.

License:GNU General Public License v3.0


Languages

Language:Python 100.0%