BDMM
BDMM copied to clipboard
The PSNR calculation formula is wrong
This repository uses the following code in this file. But the formula should be 10 * math.log10(255.0 / math.sqrt(mse)), The result of the calculation is 2 times larger than the normal result.
def compute_psnr(self, gen_imgs, gt_imgs):
mse = np.mean((gt_imgs - gen_imgs) ** 2)
if mse == 0:
return 100
return 20 * math.log10(255.0 / math.sqrt(mse))