Visual Information Fidelity (VIF)¶
Module Interface¶
- class torchmetrics.image.VisualInformationFidelity(sigma_n_sq=2.0, **kwargs)[source]¶
Compute Pixel Based Visual Information Fidelity (VIF).
As input to
forward
andupdate
the metric accepts the following inputpreds
(Tensor
): Predictions from model of shape(N,C,H,W)
with H,W ≥ 41target
(Tensor
): Ground truth values of shape(N,C,H,W)
with H,W ≥ 41
As output of forward and compute the metric returns the following output
vif-p
(Tensor
): Tensor with vif-p score
- Parameters:
kwargs¶ (
Any
) – Additional keyword arguments, see Advanced metric settings for more info.
Example
>>> from torch import randn >>> from torchmetrics.image import VisualInformationFidelity >>> preds = randn([32, 3, 41, 41]) >>> target = randn([32, 3, 41, 41]) >>> vif = VisualInformationFidelity() >>> vif(preds, target) tensor(0.0032)
Functional Interface¶
- torchmetrics.functional.image.visual_information_fidelity(preds, target, sigma_n_sq=2.0)[source]¶
Compute Pixel Based Visual Information Fidelity (VIF).
- Parameters:
- Return type:
- Returns:
Tensor with vif-p score
- Raises:
ValueError – If
data_range
is neither atuple
nor afloat