Skip to content

Latest commit

 

History

38 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Face Generator

A deep learning project that uses a Wasserstein Generative Adversarial Network with Gradient Penalty (WGAN-GP) to generate realistic human face images.

The model is trained on a dataset of facial images and learns the underlying distribution of human faces, allowing it to create entirely new, synthetic faces that do not correspond to real individuals.

Features

  • WGAN-GP implementation for stable GAN training
  • Automatic dataset download and preprocessing
  • GPU (CUDA) and CPU support
  • Generates realistic human face images
  • Built with PyTorch

Generated Face Examples

Generated Face 1 Generated Face 2 Generated Face 3 Generated Face 4 Generated Face 5 Generated Face 6

Installation

1. Clone the Repository

git clone https://github.com/MasonAndrewHarrison/Face-Generator.git
cd Face-Generator

2. Create a Virtual Environment

python -m venv venv

3. Activate the Virtual Environment

Linux / macOS

source venv/bin/activate

Windows Command Prompt

venv\Scripts\activate.bat

Windows PowerShell

venv\Scripts\Activate.ps1

4. Install PyTorch

CUDA (NVIDIA GPU)

pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu130

CPU Only

pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cpu

5. Install Dependencies

pip install -r requirements.txt

6. Download the Dataset

python create_dataset.py

7. Train the Model

python main.py

How It Works

  1. A random latent vector is sampled from a noise distribution.
  2. The generator transforms this noise into a synthetic face image.
  3. The critic (discriminator) evaluates how realistic the image appears.
  4. Gradient Penalty (GP) is used to enforce the Lipschitz constraint, improving training stability.
  5. Through adversarial training, the generator gradually learns to produce increasingly realistic faces.

About

The goal of this code is to use a WGAN-GP to generate images of peoples faces.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages