Spaces:
Sleeping
Sleeping
File size: 538 Bytes
c6494da 5f56afe bbddfb0 c6494da 5f56afe c6494da 5f56afe c6494da |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
from PIL import Image
import os
def display_image():
pass
def save_image(tensor, location="./"):
image = Image.fromarray(tensor)
if not os.path.exists(location):
os.makedirs(location)
image.save(os.path.join(location, "image.jpg"))
def log(text):
print("")
print("#############################################\n")
print(f"{text}\n")
print("#############################################\n")
import torch
def generate_noise(batch_size, z_dim):
return torch.randn(batch_size, z_dim)
|