pytorch-msssim
pytorch-msssim copied to clipboard
Unsupported for grayscale image with 1 channel or 2D input?
It seems that whether the class SSIM/MS_SSIM or the function ssim/msssim are all unsupported for the input with 1 channel. When I fed the ssim function with input array of size (1,1,1984,1984), I encountered the following error:
dim' is an invalid keyword argument for squeeze()
What's more, only 4D numpy array is supported, but not for 2D image, which requires expanding dimension first before being processed. This is also not very convenient. Please consider adding some parameters/functions for more versatile usage. Thanks for your efforts!
Hi @Ford666, please make sure that the input is a torch.Tensor.
@VainF Yeah it works, thank you! So the input must be a torch.Tensor but without limit on its channel number.
@VainF Yeah it works, thank you! So the input must be a torch.Tensor but without limit on its channel number.
I have some grayscale images,when i input 2D tensor,it reported bug.