SPADE-Tensorflow icon indicating copy to clipboard operation
SPADE-Tensorflow copied to clipboard

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

Open fido20160817 opened this issue 2 years ago • 3 comments

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

fido20160817 avatar May 02 '22 06:05 fido20160817

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'))

fido20160817 avatar May 02 '22 06:05 fido20160817

generated images are as following: 225_style0

225_style1

225_style2

fido20160817 avatar May 02 '22 06:05 fido20160817

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

fido20160817 avatar May 02 '22 06:05 fido20160817