Shortcuts

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 and update the metric accepts the following input

  • preds (Tensor): Predictions from model of shape (N,C,H,W) with H,W ≥ 41

  • target (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:

Example

>>> import torch
>>> _ = torch.manual_seed(42)
>>> from torchmetrics.image import VisualInformationFidelity
>>> preds = torch.randn([32, 3, 41, 41])
>>> target = torch.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:
  • preds (Tensor) – predicted images of shape (N,C,H,W). (H, W) has to be at least (41, 41).

  • target (Tensor) – ground truth images of shape (N,C,H,W). (H, W) has to be at least (41, 41)

  • sigma_n_sq (float) – variance of the visual noise

Return type:

Tensor

Returns:

Tensor with vif-p score

Raises:

ValueError – If data_range is neither a tuple nor a float

Read the Docs v: stable
Versions
latest
stable
v1.1.0
v1.0.3
v1.0.2
v1.0.1
v1.0.0
v0.11.4
v0.11.3
v0.11.2
v0.11.1
v0.11.0
v0.10.3
v0.10.2
v0.10.1
v0.10.0
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.2
v0.8.1
v0.8.0
v0.7.3
v0.7.2
v0.7.1
v0.7.0
v0.6.2
v0.6.1
v0.6.0
v0.5.1
v0.5.0
v0.4.1
v0.4.0
v0.3.2
v0.3.1
v0.3.0
v0.2.0
v0.1.0
Downloads
pdf
html
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.