MCPcopy Create free account
hub / github.com/CompVis/zigma / __init__

Method __init__

my_metrics.py:14–37  ·  view source on GitHub ↗
(self, device="cuda", choices=["fid"], video_frame=None)

Source from the content-addressed store, hash-verified

12
13class MyMetric:
14 def __init__(self, device="cuda", choices=["fid"], video_frame=None):
15 self.choices = choices
16 self.device = device
17 if "fid" in choices:
18 self._fid = FrechetInceptionDistance(
19 feature=2048,
20 reset_real_features=True,
21 normalize=False,
22 sync_on_compute=True,
23 ).to(device)
24 if "is" in choices:
25 self._is = InceptionScore().to(device)
26 if "kid" in choices:
27 self._kid = KernelInceptionDistance(subset_size=50).to(device)
28 if "prdc" in choices:
29 self._prdc = PRDC(nearest_k=5).to(device)
30 if "sfid" in choices:
31 self._sfid = sFrechetInceptionDistance().to(device)
32 if "fdd" in choices:
33 self._fdd = FrechetDinovDistance().to(device)
34 if "fvd" in choices:
35 self._fvd = FrechetVideoDistance()
36 self.video_frame = video_frame
37 assert video_frame is not None, "video_frame is None"
38
39 def update_real(self, data, real=True):
40 self.update_fake_and_real(data, real)

Callers

nothing calls this directly

Calls 7

InceptionScoreClass · 0.90
PRDCClass · 0.90
toMethod · 0.80

Tested by

no test coverage detected