The goal of this project is to swap faces from a source image to a given destination image.
- 🖼️ Extracts human faces using OpenCV and dlib.
- 📍 Utilizes a pretrained model to extract facial landmarks.
- 🌐 Implements a web application using Flask.
- OpenCV: For image processing and face detection.
- dlib: For extracting facial landmarks.
- Flask: For creating the web application.
-
Clone the repository:
git clone https://github.com/yourusername/face-swap-flask-app.git cd face-swap-flask-app
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Run the Flask app:
python app.py
-
Open your web browser and go to
http://127.0.0.1:5000
. -
Upload the source and destination images to perform the face swap.
app.py
: The main Flask application file.templates/
: Contains the HTML templates for the web app.static/
: Contains static files like CSS and JavaScript.requirements.txt
: Lists the dependencies required for the project.
Feel free to fork this repository and contribute by submitting a pull request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenCV
- dlib
- Flask