https://github.com/pranav-nagpure/face-swapping
Web Application to swap faces in two images
https://github.com/pranav-nagpure/face-swapping
affine-transformation delaunay-triangulation dlib html-css-javascript opencv python
Last synced: about 2 months ago
JSON representation
Web Application to swap faces in two images
- Host: GitHub
- URL: https://github.com/pranav-nagpure/face-swapping
- Owner: Pranav-Nagpure
- Created: 2023-05-11T07:46:10.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-05-19T15:22:53.000Z (about 3 years ago)
- Last Synced: 2025-01-08T02:13:26.872Z (over 1 year ago)
- Topics: affine-transformation, delaunay-triangulation, dlib, html-css-javascript, opencv, python
- Language: Python
- Homepage:
- Size: 67.4 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# __Face Swapping__
### Built Using
[![Python][python-shield]][python-url]
[![html-css-js][html-css-js-shield]][html-css-js-url]
[![Flask][flask-shield]][flask-url]
[![OpenCV][opencv-shield]][opencv-url]
[![Dlib][dlib-shield]][dlib-url]
## __About__
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
## __Getting Started__
This Project is Built With [![Anaconda][anaconda-shield]][anaconda-url] [![VSCode][vscode-shield]][vscode-url] [![Render][render-shield]][render-url]
### __Installation__
To use the app on local machine, open Anaconda Prompt and run the following commands:
1. Clone the Repository
```sh
git clone https://github.com/Pranav-Nagpure/Face-Swapping.git
```
2. Change Working Directory
```sh
cd Face-Swapping
```
3. If needed create a Virtual Environment and activate it
```sh
conda create -n environment_name python=3.10
conda activate environment_name
```
4. Install the requirements
```sh
conda install -c conda-forge dlib
python -m pip install -r requirements.txt
```
5. Run the App
```sh
python app.py
```
6. Open the URL generated in a browser to use the App
7. You can use images in the sample_images folder
[python-shield]: https://raw.githubusercontent.com/Pranav-Nagpure/Support-Repository/master/images/python-shield.png "Python"
[python-url]: https://www.python.org
[html-css-js-shield]: https://raw.githubusercontent.com/Pranav-Nagpure/Support-Repository/master/images/html-css-js-shield.png
[html-css-js-url]: https://html.spec.whatwg.org "HTML | CSS | JavaScript"
[flask-shield]: https://raw.githubusercontent.com/Pranav-Nagpure/Support-Repository/master/images/flask-shield.png "Flask"
[flask-url]: https://flask.palletsprojects.com
[opencv-shield]: https://raw.githubusercontent.com/Pranav-Nagpure/Support-Repository/master/images/opencv-shield.png
[opencv-url]: https://opencv.org "OpenCV"
[dlib-shield]: https://raw.githubusercontent.com/Pranav-Nagpure/Support-Repository/master/images/dlib-shield.png
[dlib-url]: http://dlib.net "Dlib"
[anaconda-shield]: https://raw.githubusercontent.com/Pranav-Nagpure/Support-Repository/master/images/anaconda-shield.png
[anaconda-url]: https://www.anaconda.com "Anaconda"
[vscode-shield]: https://raw.githubusercontent.com/Pranav-Nagpure/Support-Repository/master/images/vscode-shield.png
[vscode-url]: https://code.visualstudio.com "VSCode"
[render-shield]: https://raw.githubusercontent.com/Pranav-Nagpure/Support-Repository/master/images/render-shield.png
[render-url]: https://render.com "Render"