MMGEN-FaceStylor  by open-mmlab

Face stylization toolkit based on "AgileGAN" pipeline

created 3 years ago
257 stars

Top 98.8% on sourcepulse

GitHubView on GitHub
Project Summary

MMGEN-FaceStylor is an efficient toolkit for face stylization, implementing the pipeline from AgileGAN. It targets researchers and practitioners in computer vision and graphics who need to apply diverse artistic styles to portrait images. The toolkit enables high-quality stylization by leveraging inversion-consistent transfer learning, allowing users to achieve stylized results with controllable identity preservation.

How It Works

The project adopts the AgileGAN pipeline, which involves an encoder to map input images into a latent space compatible with StyleGAN2 generators. This approach allows for efficient and consistent style transfer by leveraging pre-trained, high-quality generative models. The toolkit integrates practices like adaptive discriminator augmentation (ADA), layer freezing, and perceptual similarity losses (LPIPS) to improve training stability and the quality of stylized outputs, ensuring identity preservation.

Quick Start & Requirements

  • Install: Clone the repository and install dependencies via pip install -r requirements.txt.
  • Prerequisites: CUDA 10.0/10.1, Python 3.7, PyTorch >= 1.6.0, MMCV-Full >= 1.3.15, MMGeneration >= 0.3.0.
  • Data/Weights: Download shape_predictor_68_face_landmarks.dat and pre-trained weights for various styles (e.g., FFHQ, MetFace, Toonify).
  • Demo: Run python demo/quick_try.py demo/src.png --style toonify for a quick test.
  • Docs: MMCV Docs

Highlighted Details

  • Supports various stylization applications like LayerSwap and Deep Network Interpolation (DNI) for fine-grained control.
  • Enables training custom StyleGAN2 models with user datasets in under an hour using transfer learning techniques.
  • Offers options for adaptive discriminator augmentation (ADA), layer freezing (FreezeD, FreezeG), and perceptual similarity losses (lpips_lambda).
  • Provides scripts for model interpolation and weight blending.

Maintenance & Community

This project is part of the OpenMMLab ecosystem, referencing several popular repositories. The README indicates plans for more styles, applications, and code cleanup. Community interaction channels are not explicitly mentioned.

Licensing & Compatibility

Released under Apache 2.0 license. However, some implementations may have different licenses; refer to LICENSES.md for commercial use considerations.

Limitations & Caveats

The project is based on the AgileGAN pipeline, as the original training code is not released. Some features and styles mentioned in the "Notions and TODOs" section are planned for future releases. The README notes slight differences in training parameters compared to the original paper.

Health Check
Last commit

3 years ago

Responsiveness

1 day

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

Explore Similar Projects

Feedback? Help us improve.