image_super_resolution/utils.py
def PSNR(img1, img2):
    """computes peak signal-tonoise ratio

    Args:
        img1 (np.array): image
        img2 (np.array): image

    Returns:
        float: peak signal-tonoise ratio
    """
    mse = np.mean((img1 - img2) ** 2)
    if mse == 0:
        return 100
    PIXEL_MAX = 255.0
    return 20 * np.log10(PIXEL_MAX / np.sqrt(mse))
computes peak signal-tonoise ratio

    Args:
        img1 (np.array): image
        img2 (np.array): image

    Returns:
        float: peak signal-tonoise ratio
    
computes peak signal-tonoise ratio
computes peak signal - tonoise ratio
def PSNR(img1, img2):
    mse = np.mean((img1 - img2) ** 2)
    if mse == 0:
        return 100
    PIXEL_MAX = 255.0
    return 20 * np.log10(PIXEL_MAX / np.sqrt(mse))
def PSNR ( img1 , img2 ) : mse = np . mean ( ( img1 - img2 ) ** 2 ) if mse == 0 : return 100 PIXEL_MAX = 255.0 return 20 * np . log10 ( PIXEL_MAX / np . sqrt ( mse ) )
computes peak signal-tonoise ratio
computes peak signal - tonoise ratio
"""computes peak signal-tonoise ratio

    Args:
        img1 (np.array): image
        img2 (np.array): image

    Returns:
        float: peak signal-tonoise ratio
    """
peak signal-tonoise ratio
peak signal - tonoise ratio
float
img1
None
img2
None