hififace  by maum-ai

PyTorch implementation for high-fidelity face swapping

Created 4 years ago
383 stars

Top 74.5% 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

3 years ago

Responsiveness

Inactive

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

Explore Similar Projects

Starred by Patrick von Platen Patrick von Platen(Author of Hugging Face Diffusers; Research Engineer at Mistral), Assaf Elovic Assaf Elovic(Cofounder of Tavily), and
2 more.

facechain by modelscope

0%
9k
AI toolchain for generating personalized digital-twin portraits
Created 2 years ago
Updated 10 months ago
Starred by Aravind Srinivas Aravind Srinivas(Cofounder of Perplexity), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
13 more.

pytorch3d by facebookresearch

0.1%
10k
PyTorch3D is a PyTorch library for 3D deep learning research
Created 6 years ago
Updated 3 weeks ago
Feedback? Help us improve.