taki0112 / SPADE-Tensorflow

Simple Tensorflow implementation of "Semantic Image Synthesis with Spatially-Adaptive Normalization" a.k.a. GauGAN, SPADE (CVPR 2019 Oral)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"python main.py --dataset spade_celebA --segmap_ch 3 --phase" random saved image is dark

fido20160817 opened this issue · comments

commented

I run python main.py --dataset spade_celebA --segmap_ch 3 --phase, but the sved image is dark. something is wrong.

commented

I changed related codes as following:from PIL import Image
def inverse_transform(images):
var = (images+1.) / 2
var[var < 0] = 0
var[var > 1] = 1
var = var * 255
return var

def imsave(images, size, path):
img = merge(images, size)
return img.save(path)

def merge(images, size):
h, w = images.shape[1], images.shape[2]
c = images.shape[3]
img = np.zeros((h * size[0], w * size[1], c))
for idx, image in enumerate(images):
i = idx % size[1]
j = idx // size[1]
img[hj:h(j+1), wi:w(i+1), :] = image

return Image.fromarray(img.astype('uint8'))
commented

generated images are as following:
225_style0

225_style1

225_style2

commented

the result is not very good. is this the best SPADE can achieve on human face?