Skip to content

feat: multi-scale SSIM#361

Merged
johannaSommer merged 4 commits intoPrunaAI:mainfrom
R055A:feat/multi-scale-ssim
Oct 10, 2025
Merged

feat: multi-scale SSIM#361
johannaSommer merged 4 commits intoPrunaAI:mainfrom
R055A:feat/multi-scale-ssim

Conversation

@R055A
Copy link
Copy Markdown
Contributor

@R055A R055A commented Oct 1, 2025

Description

Add feature: multi-scale SSIM

Related Issue

Fixes #359

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Unit testing

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Additional Notes


Note

Adds msssim metric via TorchMetricWrapper, generalizes ssim_update to support SSIM and MS-SSIM, and adds targeted tests (type mapping, invalid params).

  • Metrics:
    • Add MultiScaleStructuralSimilarityIndexMeasure import and new enum entry TorchMetrics.msssim using pairwise_y_gt and shared ssim_update.
    • Generalize ssim_update to accept StructuralSimilarityIndexMeasure | MultiScaleStructuralSimilarityIndexMeasure and handle float casting.
  • Tests:
    • Add tests ensuring TorchMetricWrapper('ssim') and ('msssim') instantiate the correct metric types.
    • Add negative tests validating invalid parameter combinations for SSIM/MS-SSIM raise ValueError.

Written by Cursor Bugbot for commit 5e8558f. This will update automatically on new commits. Configure here.

@begumcig begumcig self-requested a review October 1, 2025 13:44
Copy link
Copy Markdown
Member

@begumcig begumcig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @R055A, looks almost perfect to me! How about we add some tests in pruna/tests/evaluation/test_torch_metrics.py for this metric?

Comment thread src/pruna/evaluation/metrics/metric_torch.py Outdated
@R055A R055A requested a review from begumcig October 1, 2025 16:48
@R055A
Copy link
Copy Markdown
Contributor Author

R055A commented Oct 2, 2025

Thanks a lot @R055A, looks almost perfect to me! How about we add some tests in pruna/tests/evaluation/test_torch_metrics.py for this metric?

Added 6 test cases @begumcig

@johannaSommer johannaSommer self-requested a review October 2, 2025 15:36
Copy link
Copy Markdown
Member

@begumcig begumcig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for the updates, looks great!

@R055A
Copy link
Copy Markdown
Contributor Author

R055A commented Oct 10, 2025

Thank you so much for the updates, looks great!

Thank you. I just now fixed the lint error

@johannaSommer
Copy link
Copy Markdown
Member

Test failures are due to the HF servers and not related to this PR, ready to merge ☑️

@johannaSommer johannaSommer merged commit 7786a75 into PrunaAI:main Oct 10, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add Multi Scale SSIM

4 participants