noahximus / faceSwapper

Facer Swapper
Apache License 2.0
3 stars 1 forks source link

faceSwapper

faceSwapper is a Python-based web application for swapping faces in images. The project allows users to upload images, select faces, and swap faces between images. Users can also duplicate and delete faces directly from the gallery.

Table of Contents

Features

Installation

To install and run the project locally, follow these steps:

Prerequisites

Steps

  1. Clone the repository:

    git clone https://github.com/noahximus/faceSwapper.git
    cd faceSwapper
  2. Install the required dependencies:

    pip install -r requirements.txt
  3. Run the application:

    python run.py
  4. Open a web browser and go to http://127.0.0.1:5000.

Usage

  1. Choose Images: Click on choose files to add images to the gallery.
  2. Pair Faces: After selecting source and target images, pair each face from source image to target image.
  3. Duplicate Faces: Use the Duplicate + button to make copies of selected faces for reuse.
  4. Delete Faces: Remove unwanted faces from the gallery by clicking the Delete - button.
  5. Swap Faces: Use the Swap button to swap faces between the source and target images.
  6. Enhance Images: Enhance the faces after swapping using the available controls.

Gallery Management

Example of Buttons Layout:

Buttons are displayed in a column layout for easy interaction. The gap between the buttons is minimized for a cleaner UI.

Face Processing

Image Enhancement

After swapping faces, users can enhance the quality of face images. The system allows for real-time processing, and users can see a loading spinner while the images are being processed.

Face Swapping

Once images are selected and faces are detected, users can select source and target faces to swap. The system uses OpenCV for image manipulation, ensuring high-quality face swaps.

API Endpoints

The app provides the following API endpoints:

Example usage:

POST /faceSwap
Content-Type: application/json

{
    "source_image": "source_image_url",
    "target_image": "target_image_url"
}

Contributing

Contributions are welcome! Please follow these steps to contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -m 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Open a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.