MCPcopy Create free account
hub / github.com/ActiveVisionLab/DFNet / ssim

Function ssim

script/models/metrics.py:15–20  ·  view source on GitHub ↗

image_pred and image_gt: (1, 3, H, W)

(image_pred, image_gt, reduction='mean')

Source from the content-addressed store, hash-verified

13 return -10*torch.log10(mse(image_pred, image_gt, valid_mask, reduction))
14
15def ssim(image_pred, image_gt, reduction='mean'):
16 """
17 image_pred and image_gt: (1, 3, H, W)
18 """
19 dssim_ = dssim(image_pred, image_gt, 3, reduction) # dissimilarity in [0, 1]
20 return 1-2*dssim_ # in [-1, 1]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected