Closed federico-carrara closed 2 months ago
Attention: Patch coverage is 88.37209%
with 5 lines
in your changes missing coverage. Please review.
Project coverage is 87.19%. Comparing base (
427fa26
) to head (3a31d3d
). Report is 1 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
src/careamics/utils/metrics.py | 88.37% | 5 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
This PR adds metrics for the evaluation of LVAE-based splitting algorithms.
careamics
.torch.Tensor
s.Changes Made
multiscale_ssim
and_range_invariante_multiscale_ssim
functions.torch.Tensor
s since SSIM-based functions accept them.psnr()
function for the case in whichdata_range
is not provided.Additional Notes and Examples
Note about
psnr()
for further discussion and changes: the current PSNR computation is carried out by callingskimage.metrics.peak_signal_to_noise_ratio
. The problem with this function is that whendata_range
is not specified (i.e.,None
), then it is automatically inferred from the data type (np.dtype
). This can cause unexpected behavior for some data types (e.g.,float
orint64
). This is for example the case for the PSNR computed during validation, where the employed tensors are of typefloat
.Therefore, I suggest to include here a brief code snippet that automatically computes
data_range
asgt.max() - gt.min()
whenever adata_range
is not provided.Please ensure your PR meets the following requirements: