Unverified Commit 7c1b3477 authored by qwjaskzxl's avatar qwjaskzxl Committed by GitHub
Browse files

Update README.md (#2653)



* Update README.md

fix 2 bugs: (1) "previous_noisy_sample" should be in the FOR loop in line 87; (2) converting image to INT should be before "Image.fromarray" in line 91

* Apply suggestions from code review

---------
Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
parent a7cc468f
...@@ -84,13 +84,12 @@ input = noise ...@@ -84,13 +84,12 @@ input = noise
for t in scheduler.timesteps: for t in scheduler.timesteps:
with torch.no_grad(): with torch.no_grad():
noisy_residual = model(input, t).sample noisy_residual = model(input, t).sample
prev_noisy_sample = scheduler.step(noisy_residual, t, input).prev_sample
previous_noisy_sample = scheduler.step(noisy_residual, t, input).prev_sample input = prev_noisy_sample
input = previous_noisy_sample
image = (input / 2 + 0.5).clamp(0, 1) image = (input / 2 + 0.5).clamp(0, 1)
image = image.cpu().permute(0, 2, 3, 1).numpy()[0] image = image.cpu().permute(0, 2, 3, 1).numpy()[0]
image = Image.fromarray((image * 255)).round().astype("uint8") image = Image.fromarray((image * 255).round().astype("uint8"))
image image
``` ```
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment