Skip to content

A basic diffusion model to generate human faces from noise, from scratch.

Notifications You must be signed in to change notification settings

zrthxn/diffusion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Diffusion Model

A basic diffusion model based on the seminal paper by Jonathan Ho et al.


Generated Images

These are a few examples of what this model generated after a lot of debugging.

Trained Model

Find a few trained models and other things on HuggingFace.

Dataset

Smiling or Not Face Data from Kaggle.

The smiling or not smiling is not relevant to me, I just want to generate a face. I will combine all the categories of faces into one single dataset.

Usage

Installation

pip install -r requirements.txt

Download Dataset

git clone https://huggingface.co/datasets/zrthxn/SmilingOrNot data/faces
unzip data/faces/Archive.zip -d data/faces

Dryrun Sanity Check

python main.py train --dryrun

Full Training

python main.py train \
    --timesteps 500 \
    --batch_size 64 \
    --lr 0.01 \
    --epochs 500 \
    --device cuda

Generate Images

python main.py test \
    --model trained_500e.pt \
    --ns_path scheduler.json \
    --output_dir . \
    --device mps

Resources

Papers

Videos and Code

About

A basic diffusion model to generate human faces from noise, from scratch.

Topics

Resources

Stars

Watchers

Forks

Languages