SSIM for non-square images? #34
-
Hi! Is it possible to run SSIM for non-squared images (e.g. 4x10 pixels)? If impossible, what changes to ssim.py should be made? |
Beta Was this translation helpful? Give feedback.
Answered by
francois-rozet
Mar 30, 2023
Replies: 1 comment 3 replies
-
Hello @ljeonjko, Yes SSIM can be applied to non-square images. No changes to the source code is necessary. import torch
import piqa
x = torch.rand(1, 3, 42, 69)
y = torch.rand_like(x)
ssim = piqa.SSIM()
ssim(x, y) # works as expected However, an 11 by 11 convolution kernel is used in SSIM, which constraints images to have more than 11 pixels in all dimensions. |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
ljeonjko
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @ljeonjko,
Yes SSIM can be applied to non-square images. No changes to the source code is necessary.
However, an 11 by 11 convolution kernel is used in SSIM, which constraints images to have more than 11 pixels in all dimensions.