Giter Site home page Giter Site logo

benjamindyer / face-morphing Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azmarie/face-morphing

0.0 0.0 0.0 141.29 MB

๐Ÿ‘ฏโ€โ™€๏ธ We are more alike than different - morphing one face to another

Home Page: https://medium.com/@azmariewang/face-morphing-a-step-by-step-tutorial-with-code-75a663cdc666

License: MIT License

Python 100.00%

face-morphing's Introduction

Face Morphing

Create a morphing sequences betwen two faces.

Input: Two images containing faces
Output: A video showing the fluid transformation from one face to the other

Requirements

numpy
scikit_image
opencv_python
Pillow
skimage
dlib

Getting Started

Test with demo images

A photo of Jennie from Blackpink A photo of Rihanna

Generate a morphing animation video sequence

python3 code/__init__.py --img1 images/aligned_images/jennie.png --img2 images/aligned_images/rih.png --output output.mp4

Morphed Video

Test with your own images

  1. Put your images in Images folder

  2. Auto align faces with python code/utils/align_images.py images/ images/aligned_images --output_size=1024 This will look for faces in the images - crop out, align (center the nose and make the eyes horizontal), and then rescale the resulting images and save them in "aligned_images" folder.

  3. Run code/__init__.py above on your aligned face images with arg --img1 and --img2.

Key Features

  1. Detect and auto align faces in images (Optional for face morphing)
  2. Generate corresponding features points between the two images using Dlib's Facial Landmark Detection
  3. Calculate the triangular mesh with Delaunay Triangulation for each intermediate shape
  4. Warp the two input images towards the intermediate shape, perform cross-dissolve and obtain intermediate images each frame

More Results

Morphed Video

Morphed Video

To Do

Morph multiple images into a complete sequence
Morph with body landmarks

Citations

Adivces on working with facial landmarks with dlib and opencv https://www.pyimagesearch.com/2017/04/03/facial-landmarks-dlib-opencv-python/

face-morphing's People

Contributors

azmarie avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.