Skip to content

I put together this simple script that switch faces between two input images to generate quick 'Eameo'-type memes.

Notifications You must be signed in to change notification settings

frebecchi/ML-image

 
 

Repository files navigation

eameo-faceswap-generator

Inspired by the amazing work done daily by Eameo, I put together this simple script that switch faces between two input images. You can run the step-by-step ipynb in Google Colab or run python faceswap.py directly.

Installation

This script supports Python 2.7 and 3.6.

Clone this repository

$ git clone https://github.com/nicolasmetallo/eameo-faceswap-generator.git

Install Dlib

Run the following to install Dlib in Google Colaboratory.

!apt update
!apt install -y cmake
!pip install dlib

Click here for MacOS/Ubuntu instructions or Windows.

Pre-requisites

Run the following to install required modules

$ pip install -r requirements.txt

Example Usage

This script requires the user to input three file paths which can be local paths or URLs:

  • from_image = 'Path to first image where you will extract the face.'
  • to_image = 'Path to second image where you will swap the existing face'
  • output_filename = 'Path to output image.'

Now let's take two input images and set result.jpg as the output file.

$ python faceswap.py image1.jpg image2.jpg result.jpg

About

I put together this simple script that switch faces between two input images to generate quick 'Eameo'-type memes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 99.3%
  • Python 0.7%