Return valid images
Browse files
rasm.py
CHANGED
|
@@ -108,10 +108,12 @@ class Rasm:
|
|
| 108 |
|
| 109 |
# Generates a list of images, based on a list of seed for latent vectors (Z), and a list (or a single constant) of truncation_psi's.
|
| 110 |
def generate_images_from_seeds(self, seeds, truncation_psi):
|
| 111 |
-
|
|
|
|
| 112 |
|
| 113 |
def generate_randomly(self, truncation_psi = 0.5):
|
| 114 |
-
|
|
|
|
| 115 |
|
| 116 |
def generate_grid(self, truncation_psi = 0.7):
|
| 117 |
seeds = np.random.randint((2**32 - 1), size=9)
|
|
|
|
| 108 |
|
| 109 |
# Generates a list of images, based on a list of seed for latent vectors (Z), and a list (or a single constant) of truncation_psi's.
|
| 110 |
def generate_images_from_seeds(self, seeds, truncation_psi):
|
| 111 |
+
ima = self.generate_images(self.generate_zs_from_seeds(seeds), truncation_psi)[0]
|
| 112 |
+
return ima, imshow(ima)
|
| 113 |
|
| 114 |
def generate_randomly(self, truncation_psi = 0.5):
|
| 115 |
+
ima, dis = self.generate_images_from_seeds(np.random.randint(4294967295, size=1), truncation_psi=truncation_psi)
|
| 116 |
+
return ima, dis
|
| 117 |
|
| 118 |
def generate_grid(self, truncation_psi = 0.7):
|
| 119 |
seeds = np.random.randint((2**32 - 1), size=9)
|