From a0b63ee7f4a8c793c0d200c86ef07677aa4cbf2e Mon Sep 17 00:00:00 2001 From: Volpeon Date: Thu, 13 Apr 2023 07:14:24 +0200 Subject: Update --- models/convnext/discriminator.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'models/convnext') diff --git a/models/convnext/discriminator.py b/models/convnext/discriminator.py index 7dbbe3a..571b915 100644 --- a/models/convnext/discriminator.py +++ b/models/convnext/discriminator.py @@ -15,13 +15,7 @@ class ConvNeXtDiscriminator(): self.img_std = torch.tensor(IMAGENET_DEFAULT_STD).view(1, -1, 1, 1) def get_score(self, img): - img_mean = self.img_mean.to(device=img.device, dtype=img.dtype) - img_std = self.img_std.to(device=img.device, dtype=img.dtype) - - img = ((img+1.)/2.).sub(img_mean).div(img_std) - - img = F.interpolate(img, size=(self.input_size, self.input_size), mode='bicubic', align_corners=True) - pred = self.net(img) + pred = self.get_all(img) return torch.softmax(pred, dim=-1)[:, 1] def get_all(self, img): -- cgit v1.2.3-70-g09d2