I get the prediction results from the model I trained. But while I can easily show the predicted image with matplotlib, I cannot display it with PIL Image. The image's shape is 256,256,3 in size and float32 type. Image shown with matplotlib: Image and Image shown with PIL Image: Image
I use below code for matplotlib:
# gen_image is a list of predicted images
gen_image = (gen_image + 1) / 2.0
gen_image_convert = gen_image[0]
pyplot.imshow(gen_image_convert)
pyplot.axis('off')
pyplot.show()
and for PIL Image I used below code:
gen_image_convert = gen_image[0]
image = Image.fromarray((gen_image_convert * 255).astype(np.uint8)).convert('RGB')
image.show()