patrickvonplaten
commited on
Commit
·
aa18da9
1
Parent(s):
85b62fa
correct readme
Browse files
README.md
CHANGED
@@ -68,7 +68,7 @@ with torch.no_grad():
|
|
68 |
# process image
|
69 |
image_processed = image.cpu().permute(0, 2, 3, 1)
|
70 |
image_processed = (image_processed + 1.0) * 127.5
|
71 |
-
image_processed = image_processed.numpy().astype(np.uint8)
|
72 |
image_pil = PIL.Image.fromarray(image_processed[0])
|
73 |
|
74 |
image_pil.save(f"generated_image_{seed}.png")
|
@@ -94,7 +94,7 @@ image = pipeline(generator=generator, num_inference_steps=200)["sample"]
|
|
94 |
# process image
|
95 |
image_processed = image.cpu().permute(0, 2, 3, 1)
|
96 |
image_processed = (image_processed + 1.0) * 127.5
|
97 |
-
image_processed = image_processed.numpy().astype(np.uint8)
|
98 |
image_pil = PIL.Image.fromarray(image_processed[0])
|
99 |
|
100 |
image_pil.save(f"generated_image_{seed}.png")
|
|
|
68 |
# process image
|
69 |
image_processed = image.cpu().permute(0, 2, 3, 1)
|
70 |
image_processed = (image_processed + 1.0) * 127.5
|
71 |
+
image_processed = image_processed.clamp(0, 255).numpy().astype(np.uint8)
|
72 |
image_pil = PIL.Image.fromarray(image_processed[0])
|
73 |
|
74 |
image_pil.save(f"generated_image_{seed}.png")
|
|
|
94 |
# process image
|
95 |
image_processed = image.cpu().permute(0, 2, 3, 1)
|
96 |
image_processed = (image_processed + 1.0) * 127.5
|
97 |
+
image_processed = image_processed.clamp(0, 255).numpy().astype(np.uint8)
|
98 |
image_pil = PIL.Image.fromarray(image_processed[0])
|
99 |
|
100 |
image_pil.save(f"generated_image_{seed}.png")
|