Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] SSIM returns nan for sidelength < 11 #16

Open
stroblme opened this issue Dec 14, 2023 · 0 comments
Open

[BUG] SSIM returns nan for sidelength < 11 #16

stroblme opened this issue Dec 14, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@stroblme
Copy link
Member

stroblme commented Dec 14, 2023

Describe the bug
Calculating the SSIM metric for target/pred with sidelength <11 returns nan.
The reason is, that the default Gaussian Kernel uses +5 pixel in each direction thus requiring an image of at least 11 pixels.
The kernel size is automatically calculated (kernel_size parameter only considered for a uniform kernel) based on the sigma value.
E.g. sigma=1.0 produces a gaussian kernel of 9x9, thus allowing for images with sidelength >=9.
Reducing sigma would help, but raises the question if such a kernel still produces a meaningful SSIM score.

To Reproduce
Steps to reproduce the behavior:
Run experiment with sidelength <11, observe the reported SSIM metric.

Expected behavior
Either raising and error or adjusting the kernel size.

Screenshots
If applicable, add screenshots to help explain your problem.

Hardware
Please include some information regarding the hardware you've used.

Additional context
Add any other context about the problem here.

@stroblme stroblme added the bug Something isn't working label Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant