MCPcopy Create free account
hub / github.com/CompVis/diff2flow / __call__

Method __call__

diff2flow/metrics.py:36–47  ·  view source on GitHub ↗

Assumes target and pred in [-1, 1] range

(self, target, pred)

Source from the content-addressed store, hash-verified

34 )
35
36 def __call__(self, target, pred):
37 """ Assumes target and pred in [-1, 1] range """
38 real_ims = un_normalize_ims(target)
39 fake_ims = un_normalize_ims(pred)
40
41 # update FID
42 self.fid.update(real_ims, real=True)
43 self.fid.update(fake_ims, real=False)
44
45 # SSIM and PSNR
46 self.ssims.append(self.ssim(pred/2+0.5, target/2+0.5))
47 self.psnrs.append(calculate_PSNR(pred/2+0.5, target/2+0.5))
48
49 def reset(self):
50 self.ssims = []

Callers

nothing calls this directly

Calls 3

un_normalize_imsFunction · 0.90
calculate_PSNRFunction · 0.85
updateMethod · 0.80

Tested by

no test coverage detected