d. nye
commited on
Commit
·
2d44ad3
1
Parent(s):
b5fbf6d
New checkpoint and pixelation
Browse files
app.py
CHANGED
@@ -560,7 +560,7 @@ TARGET_RES = 128
|
|
560 |
|
561 |
print("Loading...")
|
562 |
|
563 |
-
url = "https://github.com/
|
564 |
|
565 |
weights_path = keras.utils.get_file(
|
566 |
"stylegan_64x64.ckpt.zip",
|
@@ -609,6 +609,7 @@ class InferenceWrapper:
|
|
609 |
res = 64
|
610 |
image = tf.image.resize(image, (res, res), method=tf.image.ResizeMethod.NEAREST_NEIGHBOR)
|
611 |
image = tf.cast(image, tf.float32) / 127.5 - 1.0
|
|
|
612 |
|
613 |
return image
|
614 |
|
|
|
560 |
|
561 |
print("Loading...")
|
562 |
|
563 |
+
url = "https://github.com/moflo/nftGAN/releases/download/v0.1/stylegan_128x128.ckpt.zip"
|
564 |
|
565 |
weights_path = keras.utils.get_file(
|
566 |
"stylegan_64x64.ckpt.zip",
|
|
|
609 |
res = 64
|
610 |
image = tf.image.resize(image, (res, res), method=tf.image.ResizeMethod.NEAREST_NEIGHBOR)
|
611 |
image = tf.cast(image, tf.float32) / 127.5 - 1.0
|
612 |
+
image = np.clip((image * 0.5 + 0.5) * 255, 0, 255).astype(np.uint8)
|
613 |
|
614 |
return image
|
615 |
|