This Web Application swaps faces in two images using Delaunay Triangulation and Affine Transformation.
Sample Images:
-
https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSx8Pu1tW1uCiZPfj9K1EL6uHxbg3bOKO9XkA&usqp=CAU
-
https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTYX1dyl9INRo5cbvDeTILRcZVzfcMsCsE0kg&usqp=CAU
Pretrained Dlib Predictor: https://github.com/tzutalin/dlib-android/raw/master/data/shape_predictor_68_face_landmarks.dat
See the implementation details with IPython Notebook
To use the app on local machine, open Anaconda Prompt and run the following commands:
- Clone the Repository
git clone https://github.com/Pranav-Nagpure/Face-Swapping.git
- Change Working Directory
cd Face-Swapping
- If needed create a Virtual Environment and activate it
conda create -n environment_name python=3.10
conda activate environment_name
- Install the requirements
conda install -c conda-forge dlib
python -m pip install -r requirements.txt
- Run the App
python app.py
-
Open the URL generated in a browser to use the App
-
You can use images in the sample_images folder