NIQE#
- class deepinv.loss.metric.NIQE(device='cpu', check_input_range=False, **kwargs)[source]#
Bases:
MetricNatural Image Quality Evaluator (NIQE) metric.
Calculates the NIQE \(\text{NIQE}(\hat{x})\) where \(\hat{x}=\inverse{y}\). It is a no-reference image quality metric that estimates the quality of images. Uses implementation from pyiqa.
Note
By default, no reduction is performed in the batch dimension.
- Example:
>>> from deepinv.utils.demo import load_example >>> from deepinv.loss.metric import NIQE >>> m = NIQE() (...) >>> x_net = load_example("celeba_example.jpg", img_size=128) >>> m(x_net) tensor([...])
- Parameters:
device (str) β device to use for the metric computation. Default: βcpuβ.
complex_abs (bool) β perform complex magnitude before passing data to metric function. If
True, the data must either be of complex dtype or have size 2 in the channel dimension (usually the second dimension after batch).reduction (str) β a method to reduce metric score over individual batch scores.
mean: takes the mean,sumtakes the sum,noneor None no reduction will be applied (default).norm_inputs (str) β normalize images before passing to metric.
l2``normalizes by L2 spatial norm, ``min_maxnormalizes by min and max of each input.check_input_range (bool) β if True,
pyiqawill raise error if inputs arenβt in the appropriate range[0, 1].