IQM_Vis.metrics.SSIM

class IQM_Vis.metrics.SSIM(return_image=False)[source]
Structural Similarity Index Measure between two images. Images must have

the same dimensions. Score given is 1 - SSIM to give the loss/dissimilarity

Parameters

return_image (bool) – Whether to return the image (Defaults to False which will return a scalar value)

__init__(return_image=False)[source]

Methods

__init__

Initialize self.

__call__(im_ref, im_comp, sigma=1.5, k1=0.01, k2=0.03, ssim_kernel_size=11, **kwargs)[source]

When an instance is called

Parameters
  • im_ref (np.array) – Reference image

  • im_comp (np.array) – Comparison image

  • **kwargs – Arbitrary keyword arguments

Returns

1-SSIM (scalar if return_image is False, image if

return_image is True)

Return type

score (np.array)