Skip to content

Calculation of SSIM #16

@XJay18

Description

@XJay18

Hi, thanks for the great project!

I am a little confused about the calculation of SSIM metric in the code.

To be specific, the inputs to ssim_fn are two floating point numbers ranging from [0,1] (because of the sigmoid activation for rgb values). If data_range argument is not passed to skimage structural_similarity function, it assumes the data range for floating point numbers to be 2 (according to the official document here), which is incorrect for this case.

So, I think the code should be

def ssim_fn(x, y):
    return structural_similarity(x, y, multichannel=True, data_range=1.0)

I would like to confirm whether I am right or not, as whether to pass data_range or not yields different output SSIM.

Looking forward to the reply and thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions