-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
metric.structural_similarity throws the wrong error for small sizes #5366
Comments
Additionally it might be worth updating the documentation for the structural_similarity function to explicitly mention this, as well as explain which function(s) people should be using instead if they need to compare (parts of an) image data that is very thin or very shallow. |
Thanks for reporting this @Pomax. Indeed this error message should be updated to be more useful in this case.
|
Can I take this issue? |
Sure! Let us know if you need any help/guidance |
@grlee77 @lilisako Small note, but the PR as merged is using the wrong syntax for the string argument to ValueError. So that's something you probably want to patch. I.e.: >>> ValueError(
... "x"
... "y"
... "z"
... )
ValueError('xyz') As opposed to >>> ValueError(
... "x",
... "y",
... "z"
... )
ValueError('x', 'y', 'z') The test does not confirm that the message in the ValueError is actually the expected error, which is probably why this wasn't caught before merging. |
@Pomax right, we didn't go this route in the end. |
Description
when using
structural_similarity
when the images are small (<7 in any dimension) aValueError
gets thrown, but with the wrong text:Instead of misleading the user into thinking there's something wrong with the way they read in, or converted, their image data, this error should read:
Way to reproduce
Version information
The text was updated successfully, but these errors were encountered: