MCPcopy Create free account
hub / github.com/IceClear/StableSR / preprocess

Method preprocess

ldm/modules/encoders/modules.py:469–474  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

467 self.register_buffer('std', torch.Tensor([0.26862954, 0.26130258, 0.27577711]), persistent=False)
468
469 def preprocess(self, x):
470 # normalize to [0,1]
471 x = (x + 1.) / 2.
472 # renormalize according to clip
473 x = kornia.enhance.normalize(x, self.mean, self.std)
474 return x
475
476 def forward(self, x):
477 # x is assumed to be in range [-1,1]

Callers 1

forwardMethod · 0.95

Calls 1

normalizeMethod · 0.80

Tested by

no test coverage detected