rocketappslab / BDMM

Official PyTorch implementation of BDMM: Bidirectionally Deformable Motion Modulation For Video-based Human Pose Transfer [ICCV 2023]
Apache License 2.0
55 stars 3 forks source link

The PSNR calculation formula is wrong #4

Open luyvlei opened 11 months ago

luyvlei commented 11 months ago

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