Closed HymEric closed 3 years ago
Sorry for that. This is because of the missed clamp function when converting the tensor into PIL image. I can not test this notebook on my own machine, so could you tell me if the latest version can get the right outputs?
It not works with output = (x_trg.squeeze(0).cpu().permute(1, 2, 0).add(1).mul(255/2)).clamp(0,255).detach().numpy().astype(np.int8)
It seems like float between [0,1] also works. Could you pull and try again?
There are negative numbers like -100 in the output image matrix even with clamp(0,255)
Use
output = x_trg.squeeze(0).cpu().permute(1, 2, 0).add(1).mul(1/2).clamp(0,1).numpy()
instead.
There may be something wrong when converting the image into np.int8.
You are right. Thank you!
You're welcomed. I'm sorry that I can not test the script myself so thank you to tell me this bug, too!
Is this right?