(self, x)
| 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] |