mirror of
https://github.com/graphdeco-inria/gaussian-splatting
synced 2024-11-25 21:28:17 +00:00
9 lines
268 B
Python
9 lines
268 B
Python
|
import torch
|
||
|
|
||
|
def mse(img1, img2):
|
||
|
return (((img1 - img2)) ** 2).view(img1.shape[0], -1).mean(1, keepdim=True)
|
||
|
|
||
|
def psnr(img1, img2):
|
||
|
mse = (((img1 - img2)) ** 2).view(img1.shape[0], -1).mean(1, keepdim=True)
|
||
|
return 20 * torch.log10(1.0 / torch.sqrt(mse))
|