CAREamics / careamics

A deep-learning library for N2V and friends
https://careamics.github.io/
BSD 3-Clause "New" or "Revised" License
30 stars 6 forks source link

feat: added more metrics for evaluation of Splitting results #230

Closed federico-carrara closed 2 months ago

federico-carrara commented 2 months ago

Description

This PR adds metrics for the evaluation of LVAE-based splitting algorithms.

Changes Made

Additional Notes and Examples

Note about psnr() for further discussion and changes: the current PSNR computation is carried out by calling skimage.metrics.peak_signal_to_noise_ratio. The problem with this function is that when data_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 or int64). This is for example the case for the PSNR computed during validation, where the employed tensors are of type float.

Therefore, I suggest to include here a brief code snippet that automatically computes data_range as gt.max() - gt.min() whenever a data_range is not provided.


Please ensure your PR meets the following requirements:

codecov[bot] commented 2 months ago

Codecov Report

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:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #230 +/- ## ========================================== - Coverage 87.20% 87.19% -0.02% ========================================== Files 130 130 Lines 4876 4911 +35 ========================================== + Hits 4252 4282 +30 - Misses 624 629 +5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.