Skip to content

vuongnp/face-swap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Face Swap Application

This project is a Streamlit web application that allows users to perform face swapping between images. Users can upload a source image and a target face image, detect faces in the source image, and select a specific face to swap with the target face.

Project Structure

face-swap-app
├── app.py               # Main entry point of the Streamlit application
├── utils                # Utility functions for face detection and swapping
│   ├── __init__.py     # Initialization file for the utils module
│   └── face_swap.py    # Contains functions for face detection and swapping
├── models               # Directory containing pre-trained models
│   └── inswapper_128.onnx # Pre-trained model for face swapping
├── requirements.txt     # Lists the dependencies required for the project
└── README.md            # Documentation for the project

Setup Instructions

  1. Clone the repository:

    git clone <repository-url>
    cd face-swap-app
  2. Install the required dependencies: It is recommended to use a virtual environment. You can create one using venv or conda.

    pip install -r requirements.txt
  3. Run the application: Start the Streamlit application by running:

    streamlit run app.py

Usage Guidelines

  • Upload a source image that contains one or more faces.
  • Upload a target face image that you want to swap with.
  • Select the "Multiple face" option to detect and display faces in the source image.
  • Choose a face ID from the detected faces for swapping.
  • The application will display the result of the face swap operation.

Dependencies

The project requires the following Python packages:

  • Streamlit
  • OpenCV
  • InsightFace

Make sure to install all dependencies listed in requirements.txt before running the application.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages