patrickvonplaten commited on
Commit
95752c1
2 Parent(s): 7d182da 1ac0149

Merge branch 'main' of https://huggingface.co/google/ddpm-celeba-hq into main

Browse files
Files changed (1) hide show
  1. README.md +45 -0
README.md ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - pytorch
5
+ - diffusers
6
+ - unconditional-image-generation
7
+ ---
8
+
9
+ # Denoising Diffusion Probabilistic Models (DDPM)
10
+
11
+ **Paper**: [Denoising Diffusion Probabilistic Models](https://arxiv.org/abs/2006.11239)
12
+
13
+ **Abstract**:
14
+
15
+ *We present high quality image synthesis results using diffusion probabilistic models, a class of latent variable models inspired by considerations from nonequilibrium thermodynamics. Our best results are obtained by training on a weighted variational bound designed according to a novel connection between diffusion probabilistic models and denoising score matching with Langevin dynamics, and our models naturally admit a progressive lossy decompression scheme that can be interpreted as a generalization of autoregressive decoding. On the unconditional CIFAR10 dataset, we obtain an Inception score of 9.46 and a state-of-the-art FID score of 3.17. On 256x256 LSUN, we obtain sample quality similar to ProgressiveGAN.*
16
+
17
+ ## Usage
18
+
19
+ ```python
20
+ # !pip install diffusers
21
+ from diffusers import DiffusionPipeline
22
+ import PIL.Image
23
+ import numpy as np
24
+
25
+ model_id = "google/ddpm-celeba-hq"
26
+
27
+ # load model and scheduler
28
+ ddpm = DiffusionPipeline.from_pretrained(model_id)
29
+
30
+ # run pipeline in inference (sample random noise and denoise)
31
+ image = ddpm()
32
+
33
+ # process image to PIL
34
+ image_processed = image.cpu().permute(0, 2, 3, 1)
35
+ image_processed = (image_processed + 1.0) * 127.5
36
+ image_processed = image_processed.numpy().astype(np.uint8)
37
+ image_pil = PIL.Image.fromarray(image_processed[0])
38
+
39
+ # save image
40
+ image_pil.save("test.png")
41
+ ```
42
+
43
+ ## Samples
44
+
45
+ TODO ...