Git Product home page Git Product logo

diffusion's Introduction

Diffusion

A basic diffusion model from scratch - Denoising Diffusion Probabilistic Models (DDPM) pipeline. Build on top of https://github.com/cloneofsimo/minDiffusion/tree/master. Note it supports both DDPM with and without additional conditions (e.g. text information).

Installation

  1. Create a conda environment.
conda create --name diffusion python=3.9 -y
conda activate diffusion
  1. Install PyTorch.
pip install torch torchvision torchaudio
  1. Install additional libraries.
pip install tqdm openai-clip

Data Preparation

  1. CIFAR10

No preparation needed.

  1. Customized dataset

Download your own images into ./data and write your customized data loader.

Train

Run the below commad. You can specify different DDPM models (DDPM with NaiveUnet, DDPM with ContextUnet) and hyperparamters inside.

python train.py

Inference

Run the below command. You can specify different models (NaiveUnet, ContextUnet) and hyperparamters inside.

python inference.py

Results

  1. DDPM 1000 steps CIFAR10 without conditions and trained with 100 epochs.

Generated images

  1. DDPM 1000 steps CIFAR10 with one-hot encoding class conditions and trained with 100 epochs. The first to last row is conditioned on 'automobile', 'cat', 'dog', and 'ship', respectively.

Generated images

  1. DDPM 1000 steps CIFAR10 with text embedding class conditions and trained with 100 epochs. The first to last row is conditioned on 'automobile', 'cat', 'dog', and 'ship', respectively.

Generated images

Checkpoints

  1. DDPM without conditions (NaiveUnet) trained with 100 epochs on CIFAR10.

https://drive.google.com/file/d/1e95Rkgb1DtvFPuyynMipOPprMcgrp99j/view?usp=sharing

  1. DDPM with one-hot encoding class conditions (ContextUnet) and trained with 100 epochs on CIFAR10.

https://drive.google.com/file/d/1tK6a1mOisSM-holI8Ou3AFlX5MTzCr7i/view?usp=sharing

  1. DDPM with text embedding class conditions (ContextUnet) and trained with 100 epochs on CIFAR10.

https://drive.google.com/file/d/1OZwl_cjNqretPH-Azj3sMoYC4jFNt_Jc/view?usp=sharing

diffusion's People

Contributors

liuch37 avatar

Stargazers

 avatar

Watchers

 avatar Kostas Georgiou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.