mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-21 15:15:43 +08:00
14 lines
239 B
Python
14 lines
239 B
Python
"""
|
|
Collection of metrics.
|
|
"""
|
|
|
|
import torch
|
|
|
|
|
|
def get_psnr(image_gt, image_pred):
|
|
"""
|
|
Returns the psnr for an image. TODO: add masking
|
|
"""
|
|
mean = torch.mean((image_gt - image_pred) ** 2)
|
|
return -10 * torch.log10(mean)
|