Skip to content

Latest commit

 

History

History
34 lines (33 loc) · 1.47 KB

README.md

File metadata and controls

34 lines (33 loc) · 1.47 KB

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