We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
from torchmetrics.image.psnr import PeakSignalNoiseRatio metric = PeakSignalNoiseRatio(clamp=[0, 1]) for inputs, targets in dataloader: outputs = model(inputs) metric(outputs, targets)
Then we will clamp images to $[0, 1]$, and calculate data_range = 1 - 0.
data_range = 1 - 0
Image have a legal range, $[0, 255]$ or $[0, 1]$, so a clamp is necessary for calculate PSNR.
from torchmetrics.image.psnr import PeakSignalNoiseRatio metric = PeakSignalNoiseRatio(data_range=[0, 1]) for inputs, targets in dataloader: outputs = model(inputs) metric(outputs, targets)
if data_range is a int, it keep same behaviour as before. if it is a list, will clamp image to data_range and calculate its delta as data_range.
data_range
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
🚀 Feature
Then we will clamp images to$[0, 1]$ , and calculate
data_range = 1 - 0
.Motivation
Image have a legal range,$[0, 255]$ or $[0, 1]$ , so a clamp is necessary for calculate PSNR.
Pitch
Alternatives
if
data_range
is a int, it keep same behaviour as before. if it is a list, will clamp image to data_range and calculate its delta as data_range.Additional context
The text was updated successfully, but these errors were encountered: