Skip to content

SSIM for non-square images? #34

Answered by francois-rozet
ljeonjko asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ljeonjko
Comment options

@francois-rozet
Comment options

@ljeonjko
Comment options

Answer selected by ljeonjko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants