input_details = interpreter.get_input_details()
output_details = interpreter.get_output_details()
# Set the 'latent' input tensor.
input_shape = input_details[0]['shape']
latent = (np.random.random_sample(input_shape) - 0.5) * 2.0
input_data = np.array(latent, dtype=np.float32)
interpreter.set_tensor(input_details[0]['index'], input_data)
# Get the output image and transform it for display
result = interpreter.get_tensor(output_details[0]['index'])
result = np.reshape(result, [256,256,3])
result = (result + 1.0) * 127.5
result = pygame.surfarray.make_surface(result)
result = pygame.transform.rotate(result, -90)