Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect max_val Parameter in peak_signal_noise_ratio function for Normalized Images #9

Open
sidd1915 opened this issue Dec 20, 2024 · 0 comments

Comments

@sidd1915
Copy link

The peak_signal_noise_ratio function in the current implementation uses max_val=255.0. However, the images are normalized to the range [0, 1] in the read_image function:
image = tf.cast(image, dtype=tf.float32) / 255.0
Since the pixel values of y_true and y_pred are in the range [0, 1], the max_val parameter in tf.image.psnr should be set to 1.0 instead of 255.0 to correctly compute the PSNR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant