Skip to content

[Refactoring] Add torchmetrics compatible scale invariant PSNR metric #568

@veegalinova

Description

@veegalinova

Description

In #565 we are pinning the torchmetrics version to avoid a new data_range parameter error.
I think that it is beneficial to keep torchmetrics around to have an extensible list of available metrics with a simple API. But, we can not use their data_range parameter because we do not know the correct range at the initialization time.

So I propose to create a metric based on the existing scale_invariant_psnr that will be compatible with torchmetric's MetricCollection. Glancing at the tutorial it seems straightforward enough, a couple of methods will need to be added.

Where in the code

MetricCollection and PSNR metrics are initialized in lightning module UnetModule, classes that inherit from it can call it during validation to log metrics.

References

Reference issue #550
Current torchmetrics usage: src/careamics/lightning/dataset_ng/lightning_modules/unet_module.py

Metadata

Metadata

Assignees

Labels

refactoringStreamline and improve source code

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions