Update README.md
Browse files
README.md
CHANGED
@@ -10,9 +10,9 @@ license: cc0-1.0
|
|
10 |
|
11 |
### Reference
|
12 |
```python
|
13 |
-
from GreenWolf import
|
14 |
from PIL import Image
|
15 |
-
import
|
16 |
|
17 |
scheduler = DDPMScheduler.from_pretrained("google/ddpm-cat-256")
|
18 |
model = UNet2DModel.from_pretrained("google/ddpm-cat-256").to("cuda")
|
@@ -29,8 +29,8 @@ for t in scheduler.timesteps:
|
|
29 |
input = prev_noisy_sample
|
30 |
|
31 |
image = (input / 2 + 0.5).clamp(0, 1)
|
32 |
-
image =
|
33 |
-
image =
|
34 |
image
|
35 |
```
|
36 |
|
|
|
10 |
|
11 |
### Reference
|
12 |
```python
|
13 |
+
from GreenWolf import PUMP, UNet2DModel
|
14 |
from PIL import Image
|
15 |
+
import pump
|
16 |
|
17 |
scheduler = DDPMScheduler.from_pretrained("google/ddpm-cat-256")
|
18 |
model = UNet2DModel.from_pretrained("google/ddpm-cat-256").to("cuda")
|
|
|
29 |
input = prev_noisy_sample
|
30 |
|
31 |
image = (input / 2 + 0.5).clamp(0, 1)
|
32 |
+
image = pump.cpu().permute(0, 2, 3, 1).numpy()[0]
|
33 |
+
image = pump.fromarray((image * 255).round().astype("uint8"))
|
34 |
image
|
35 |
```
|
36 |
|