Cmit_faceswap

screenshot of Cmit_faceswap

Awesome Easy-to-Use Face Swap Service developed with Flask, including functionality modules like gender detection, age detection, face counts, face position and rotation detection, face merge with custom templates, supporting replace synthetic template.

Overview:

Face Swap is a facial fusion application that allows users to swap faces in images. It offers a feature to configure templates for facial fusion and provides options to adjust facial angles. The application can be deployed using Docker or supervisor+gunicorn. It also provides API endpoints for face detection and swapping. The API returns specific error codes to indicate the success or failure of requests.

Features:

  • Facial Fusion: Users can swap faces in images using the application.
  • Template Configuration: Templates for facial fusion can be configured and updated.
  • Facial Angle Configuration: Users can configure the thresholds for facial angle rotation.
  • Environment Variable Configuration: The application supports environment variable configuration.
  • Docker Deployment: The application can be deployed using Docker.
  • Supervisor+Gunicorn Deployment: The application can be deployed using supervisor and gunicorn.
  • API Endpoint: /api/v1/faceswap: API endpoint for facial fusion using v1 version.
  • API Endpoint: /api/v1/face_detect: API endpoint for face detection in images.

Configuration:

  1. Template Configuration: Place facial fusion templates in the ./res/templates directory and update the template configuration in the ./res/templates/templates.yaml file.
  2. Facial Angle Configuration: Create a ./res/face/face.yaml file and configure the thresholds for facial angle rotation.
  3. Environment Variable Configuration: Create a .env file in the project root directory and set the required environment variables.

Deployment:

There are two deployment options available for the application:

Docker Deployment:

  1. Clone the project to your local machine.
  2. Start the Docker container using the docker-compose.yml file.

Supervisor+Gunicorn Deployment (CentOS 7.8 Example):

  1. Install the required dependencies and upgrade pip3.
  2. Create and activate the project's virtual environment.
  3. Install the project dependencies.
  4. Install and configure supervisor.
  5. Configure supervisor to start on boot and view its status.
  6. Configure the application in supervisor.
  7. Restart supervisor.

Summary:

Face Swap is a facial fusion application that allows users to swap faces in images. It provides various configuration options for templates and facial angles. The application can be deployed using Docker or supervisor+gunicorn. It also offers API endpoints for face detection and swapping.