Skip to content
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

SSIM output range #40

Open
ksmdnl opened this issue Mar 18, 2022 · 2 comments
Open

SSIM output range #40

ksmdnl opened this issue Mar 18, 2022 · 2 comments

Comments

@ksmdnl
Copy link

ksmdnl commented Mar 18, 2022

Quick question on the output range. Does the SSIM implementation output number of range [0;1] or [-1;1] instead as described in the original SSIM paper http://www.cns.nyu.edu/pub/lcv/wang03-reprint.pdf ?

@beyzacevik
Copy link

I have the same question in mind. Can you please clarify this?

@lartpang
Copy link

lartpang commented Jun 21, 2022

@beyzacevik @ksmdnl

There is an additional parameter $L$ involved in the original paper, which defaults to 1 in this implementation.

In fact, this parameter needs to be set separately for different data types. In the implementation provided in skimage (https://scikit-image.org/docs/dev/api/skimage.metrics.html#structural-similarity), it will perform the corresponding conversion according to the data type.

I have implemented a new pytorch version of ssim here, and provided this interface to the user. You can set it manually.

        self.C1 = (K1 * L) ** 2  # equ 7 in ref1
        self.C2 = (K2 * L) ** 2  # equ 7 in ref1

https://github.com/lartpang/MSSIM.pytorch/blob/1584aad5a05e403041fb9c6d27bbb991182c6bfe/ssim.py#L84-L85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants