hififace  by maum-ai

PyTorch implementation for high-fidelity face swapping

created 3 years ago
372 stars

Top 77.3% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides an unofficial PyTorch implementation of HifiFace, a high-fidelity face swapping model. It targets researchers and developers interested in advanced face manipulation techniques, offering a 256x256 resolution implementation guided by 3D shape and semantic priors for realistic results.

How It Works

The HifiFace architecture comprises three main components: a 3D shape-aware identity extractor, a semantic facial fusion module, and an encoder-decoder structure. This approach leverages 3D facial priors and semantic information to achieve high-fidelity face swaps, distinguishing it from methods that rely solely on 2D image manipulation.

Quick Start & Requirements

  • Installation: Build a Docker image (docker build -t hififace:latent .) and run it (docker run ...).
  • Prerequisites: Requires cloning several repositories (Deep3DFaceRecon_pytorch, nvdiffrast, insightface), downloading pre-trained models for Deep3DFace and ArcFace, and potentially using face segmentation models from PSFRGAN. CUDA is implicitly required for GPU acceleration.
  • Setup: Detailed setup involves cloning multiple repos and managing pre-trained checkpoints.
  • Links: Official Paper

Highlighted Details

  • Implements the 256x256 version of HifiFace.
  • Uses PyTorch Lightning for a streamlined PyTorch workflow.
  • Supports interpolation of identity, 3D shape, or both.
  • Utilizes a multi-scale discriminator from SPADE, differing from the original StarGAN v2 discriminator.

Maintenance & Community

  • Developed by MINDs Lab, Inc.
  • No explicit community links (Discord/Slack) or roadmap are provided in the README.

Licensing & Compatibility

  • License: BSD 3-Clause License.
  • Compatibility: Permissive license suitable for commercial use and integration with closed-source projects.

Limitations & Caveats

The implementation uses VGGFace2 for training instead of the Asian-Celeb dataset mentioned in the paper due to accessibility issues. The pre-processing code for face alignment is noted as "to be added."

Health Check
Last commit

2 years ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
9 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.