How to show image from tensor?

Hello ! I have tensor with shape of torch.Size([1, 2, 1080, 1920]) and i want to see this as image.
How can i do it please ?

You can use torchvision.utils.save_image from here

1 Like

I cant realise what put into fp parameter. Can you give me example ?

torchvision.utils.save_image(y_pred, example) ?


torchvision.utils.save_image(IMAGE_TENSOR, fp=FILEPATH)

fp just is the filepath that you want to put the image. So you could do something like output.png

1 Like