MS-SSIM minimum crop size: 161px #11
-
I found that the MS-SSIM loss generates an error with crop sizes of less than 161 pixels. Is that a limitation of MS-SSIM, a possibly sub-optimal crop size, a missing parameter, and/or an implementation specificity?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello @trougnouf 👋 This is a limitation of the metric itself. During the processing, the image is recursively sub-sampled 4 times, meaning its size is reduced by a factor A solution could be to add (virtual) padding during the convolutions (which I actually did in the past), but the metric would not be consistent with other implementations anymore. An alternative is to add a (boolean) parameter that would trigger that behavior. |
Beta Was this translation helpful? Give feedback.
Hello @trougnouf 👋
This is a limitation of the metric itself. During the processing, the image is recursively sub-sampled 4 times, meaning its size is reduced by a factor
2^4 = 16
. But the convolution kernel size is11×11
by default in SSIM, and as the error says:kernel size can't be greater than actual input size
. In the original paper the metric is used on768×512
images or similar.A solution could be to add (virtual) padding during the convolutions (which I actually did in the past), but the metric would not be consistent with other implementations anymore. An alternative is to add a (boolean) parameter that would trigger that behavior.