patrickvonplaten
commited on
Commit
•
31e2197
1
Parent(s):
5d6cca4
change image processing
Browse files- generated_image_pipeline.png +0 -0
- generated_image_unrolled.png +0 -0
- run.py +2 -2
generated_image_pipeline.png
CHANGED
generated_image_unrolled.png
CHANGED
run.py
CHANGED
@@ -46,7 +46,7 @@ with torch.no_grad():
|
|
46 |
|
47 |
# process image
|
48 |
image_processed = image.cpu().permute(0, 2, 3, 1)
|
49 |
-
image_processed = image_processed *
|
50 |
image_processed = image_processed.numpy().astype(np.uint8)
|
51 |
image_pil = PIL.Image.fromarray(image_processed[0])
|
52 |
|
@@ -69,7 +69,7 @@ image = pipeline(generator=generator, num_inference_steps=50)["sample"]
|
|
69 |
|
70 |
# process image
|
71 |
image_processed = image.cpu().permute(0, 2, 3, 1)
|
72 |
-
image_processed = image_processed *
|
73 |
image_processed = image_processed.numpy().astype(np.uint8)
|
74 |
image_pil = PIL.Image.fromarray(image_processed[0])
|
75 |
|
|
|
46 |
|
47 |
# process image
|
48 |
image_processed = image.cpu().permute(0, 2, 3, 1)
|
49 |
+
image_processed = (image_processed + 1.0) * 127.5
|
50 |
image_processed = image_processed.numpy().astype(np.uint8)
|
51 |
image_pil = PIL.Image.fromarray(image_processed[0])
|
52 |
|
|
|
69 |
|
70 |
# process image
|
71 |
image_processed = image.cpu().permute(0, 2, 3, 1)
|
72 |
+
image_processed = (image_processed + 1.0) * 127.5
|
73 |
image_processed = image_processed.numpy().astype(np.uint8)
|
74 |
image_pil = PIL.Image.fromarray(image_processed[0])
|
75 |
|