Hi!
I have trained a convolutional autoencoder with rgb images for 20 epochs (I have taken the architecture already used for faces) and wanted to see the results at the output. However I have some color distorsion. I am using matplotlib imshow to show images.
The code is the following:
x, _ = next(analysis_loader)
z_points = model.encoder(x.unsqueeze(0).to(device))
reconst_imgs = model.decoder(z_points)

plt.figure(figsize=(5,5))
x = x.permute(1,2,0)
plt.imshow(x)

plt.figure(figsize=(5,5))
img = reconst_imgs.squeeze()
img = img.detach().cpu().permute(1,2,0)
plt.imshow(img)

The result is the following:

Capture328×639 26.6 KB

I have tried to change channel order with numpy.dstack but it only changes the tone into blue, green, red,…
I don’t know if it is related with tensor format. When plotting plt.imshow does not complaing about clipping however the range of the first image is [0,1] while the output image is [0.98,0.05]. Do I have to normalize the image? Should I train the model more?
Thanks in advance.