Update app.py
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ def generate_images (initial_archi, initial_class, batch_size):
|
|
35 |
save_as_images(output)
|
36 |
return output
|
37 |
|
38 |
-
|
39 |
""" Convert an output tensor from BigGAN in a list of images.
|
40 |
Params:
|
41 |
obj: tensor or numpy array of shape (batch_size, channels, height, width)
|
@@ -59,7 +59,7 @@ def generate_images (initial_archi, initial_class, batch_size):
|
|
59 |
img.append(PIL.Image.fromarray(out_array))
|
60 |
return img
|
61 |
|
62 |
-
|
63 |
output = generate_images (initial_archi, initial_class, 1)
|
64 |
PIL_output = convert_to_images(output)
|
65 |
return PIL_output[0]
|
|
|
35 |
save_as_images(output)
|
36 |
return output
|
37 |
|
38 |
+
def convert_to_images(obj):
|
39 |
""" Convert an output tensor from BigGAN in a list of images.
|
40 |
Params:
|
41 |
obj: tensor or numpy array of shape (batch_size, channels, height, width)
|
|
|
59 |
img.append(PIL.Image.fromarray(out_array))
|
60 |
return img
|
61 |
|
62 |
+
def inference(initial_archi, initial_class):
|
63 |
output = generate_images (initial_archi, initial_class, 1)
|
64 |
PIL_output = convert_to_images(output)
|
65 |
return PIL_output[0]
|