Skip to content

SSIM returning wrong values and limited to uniform kernel only #6249

@Warvito

Description

@Warvito

Describe the bug
The SSIMMetric is reshaping the values with view(ssim_value.shape[1], -1) instead view(ssim_value.shape[0], -1) returning a vector of (channels, 1) shape instead (batch, 1).

ssim_per_batch: torch.Tensor = ssim_value.view(ssim_value.shape[1], -1).mean(1, keepdim=True)

Besides that, in most packages we compute the SSIM using an gaussian kernel, instead a uniform kernel. The option to be able to choose the type of kernel should be added.

Finally, in most package, there is no cov_norm parameter, producing a significantly different value when compared to the torchmetrics package with an uniform kernel, and compared to torchmetrics, piq and pytorch-msssim when using an gaussian kernel

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions