BDMM icon indicating copy to clipboard operation
BDMM copied to clipboard

The PSNR calculation formula is wrong

Open luyvlei opened this issue 2 years ago • 0 comments

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))

luyvlei avatar Dec 18 '23 08:12 luyvlei