Skip to content

MS-SSIM minimum crop size: 161px #11

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

You must be logged in to vote

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 is 11×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 on 768×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.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@trougnouf
Comment options

@francois-rozet
Comment options

Answer selected by francois-rozet
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