SAM  by yuval-alaluf

Image-to-image translation research paper for age transformation using StyleGAN

created 4 years ago
705 stars

Top 49.5% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This repository provides the official implementation for age transformation using a StyleGAN latent space, enabling fine-grained control over facial aging. It's designed for researchers and practitioners in computer vision and graphics interested in image-to-image translation and controllable generative models. The key benefit is achieving realistic age progression/regression while preserving identity, with added capabilities for style mixing.

How It Works

The method encodes input facial images into the latent space of a pre-trained StyleGAN, guided by an age regression network. This approach treats aging as a regression task, allowing for continuous control over the target age. It learns a disentangled, non-linear aging path within StyleGAN's latent space, offering more flexibility than methods relying solely on latent space priors.

Quick Start & Requirements

  • Install: Recommended via Anaconda using environment/sam_env.yaml.
  • Prerequisites: Linux or macOS, NVIDIA GPU with CUDA and CuDNN, Python 3.
  • Pretrained Models: Requires downloading sam_ffhq_aging.pt and shape_predictor_68_face_landmarks.dat. Auxiliary models (pSp encoder, StyleGAN, IR-SE50, VGG Age Classifier) are also needed and assumed to be in pretrained_models.
  • Demo: An online demo is available via Replicate.
  • Notebooks: Jupyter notebooks for inference and animation are provided.

Highlighted Details

  • Enables fine-grained age transformation with identity preservation.
  • Supports style mixing using reference images or random latent vectors.
  • Generates outputs at 1024x1024 resolution, with an option to resize.
  • Offers detailed scripts for training, inference, and advanced manipulation.

Maintenance & Community

The project is the official implementation of a SIGGRAPH 2021 paper. Key components are derived from other well-maintained repositories (StyleGAN2, pixel2style2pixel). Links to relevant research papers and codebases are provided in the Credits section.

Licensing & Compatibility

The project itself does not explicitly state a license in the README. However, it heavily relies on and credits components with MIT, Apache 2.0, and BSD 2-Clause licenses. Compatibility for commercial use would require careful review of the licensing of all constituent parts.

Limitations & Caveats

The project is not inherently supported on CPU, requiring specific NVIDIA hardware. Data preparation for training involves defining paths in configuration files, which may require familiarity with the project's structure.

Health Check
Last commit

1 year ago

Responsiveness

1 day

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

Explore Similar Projects

Feedback? Help us improve.