metrics
Metrics utilities for LVAE training and evaluation.
RunningPSNR #
Track the running PSNR over validation batches.
Source code in src/careamics/lvae_training/metrics.py
get() #
Return the current PSNR.
Source code in src/careamics/lvae_training/metrics.py
reset() #
update(rec, tar) #
Update statistics with a batch of reconstructed and target images.
Source code in src/careamics/lvae_training/metrics.py
PSNR(gt, pred, range_=None) #
Compute PSNR for tensors shaped as (batch, H, W).
Source code in src/careamics/lvae_training/metrics.py
RangeInvariantPsnr(gt, pred) #
Compute range-invariant PSNR for grayscale images.
Source code in src/careamics/lvae_training/metrics.py
avg_psnr(target, prediction) #
avg_range_inv_psnr(target, prediction) #
Compute mean and standard error of range-invariant PSNR.
avg_ssim(target, prediction) #
Compute mean and standard deviation of SSIM.
Source code in src/careamics/lvae_training/metrics.py
compute_SE(arr) #
compute_custom_ssim(gt_, pred_, ssim_obj_dict) #
Compute SSIM using custom per-channel scorers.
Source code in src/careamics/lvae_training/metrics.py
compute_masked_psnr(mask, tar1, tar2, pred1, pred2) #
Compute PSNR on masked regions for two target/prediction pairs.
Source code in src/careamics/lvae_training/metrics.py
compute_multiscale_ssim(gt_, pred_, range_invariant=True) #
Compute channel-wise multiscale SSIM.
Source code in src/careamics/lvae_training/metrics.py
compute_stats(highres_data, pred_unnorm, verbose=True) #
Compute PSNR- and SSIM-based metrics on high-SNR data.
Source code in src/careamics/lvae_training/metrics.py
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 | |
fix(gt, x) #
Zero-mean tensors and match prediction range to the ground truth.
fix_range(gt, x) #
Rescale a tensor to match the range of the ground truth.
range_invariant_multiscale_ssim(gt_, pred_) #
Compute range-invariant multiscale SSIM for one channel.