Given a Tensor representing the image, use .permute() to put the channels as the last dimension:
plt.imshow( tensor_image.permute(1, 2, 0) )
Note: permute does not copy or allocate memory, and from_numpy() doesn’t either.
Given a Tensor representing the image, use .permute() to put the channels as the last dimension:
plt.imshow( tensor_image.permute(1, 2, 0) )
Note: permute does not copy or allocate memory, and from_numpy() doesn’t either.