Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
datasets:
|
3 |
+
- eurecom-ds/shapes3d
|
4 |
+
pipeline_tag: unconditional-image-generation
|
5 |
+
---
|
6 |
+
|
7 |
+
# !pip install diffusers
|
8 |
+
from diffusers import DiffusionPipeline
|
9 |
+
import torch
|
10 |
+
|
11 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
12 |
+
model_id = "eurecom-ds/scoresdeve-ema-3dshapes-64"
|
13 |
+
|
14 |
+
# load model and scheduler
|
15 |
+
pipe = DiffusionPipeline.from_pretrained(model_id, trust_remote_code=True)
|
16 |
+
pipe.to(device)
|
17 |
+
|
18 |
+
|
19 |
+
# run pipeline in inference (sample random noise and denoise)
|
20 |
+
generator = torch.Generator(device=device).manual_seed(46)
|
21 |
+
image = pipe(
|
22 |
+
generator=generator,
|
23 |
+
batch_size=1,
|
24 |
+
num_inference_steps=1000
|
25 |
+
).images
|
26 |
+
|
27 |
+
|
28 |
+
# save image
|
29 |
+
image[0].save("sde_ve_generated_image.png")
|
30 |
+
|
31 |
+
|
32 |
+

|