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 calculation #3

Open
nikoskot opened this issue Nov 7, 2024 · 1 comment
Open

SSIM calculation #3

nikoskot opened this issue Nov 7, 2024 · 1 comment

Comments

@nikoskot
Copy link

nikoskot commented Nov 7, 2024

I believe there is an issue with the calculation of the SSIM metric inside 'parallel_score.py'. I can see that it uses the metrics.structural_similarity() function from skimage.
As from the end of 2022 this method needs the 'data_range' parameter to be explicitly set by the user, otherwise it throws an error.

The real issue though is that before the assignment of the parameter became mandatory, if you ignored it, the value would be calculated automatically and it would be set to 2 for floating point inputs, like in the case of Earthnet2021 images. This is also explained in the official skimage documentation, where it is also mentioned why it should be 1 instead of 2 (images should not have negative pixel values).
Using data_range = 2 also yields a higher SSIM metric, compared to when setting it to 1.

@vitusbenson
Copy link
Contributor

Oh wow! Great catch @nikoskot ! Feel free to open a pull request :)
But please note also, we have moved away from using EarthNetScore, see the recent GreenEarthNet paper https://github.com/vitusbenson/greenearthnet?tab=readme-ov-file

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

2 participants