Update README.md

This commit is contained in:
Suraj Patil 2022-06-15 15:59:16 +02:00 committed by GitHub
parent 57a70b809e
commit 3d335f833c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -195,11 +195,11 @@ model = UNetModel.from_pretrained(model_id)
scheduler = PNDMScheduler() scheduler = PNDMScheduler()
# load model and scheduler # load model and scheduler
ddpm = PNDM(unet=model, noise_scheduler=scheduler) pndm = PNDM(unet=model, noise_scheduler=scheduler)
# run pipeline in inference (sample random noise and denoise) # run pipeline in inference (sample random noise and denoise)
with torch.no_grad(): with torch.no_grad():
image = ddpm() image = pndm()
# process image to PIL # process image to PIL
image_processed = image.cpu().permute(0, 2, 3, 1) image_processed = image.cpu().permute(0, 2, 3, 1)