Esempio n. 1
0
    def __init__(self, device):
        self.dtype = torch.FloatTensor if device == 'cpu' else torch.cuda.FloatTensor

        VGG_FACE = vgg_face(pretrained=True)
        self.VGG_FACE_AC = VGG_Activations(VGG_FACE,
                                           [1, 6, 11, 18, 25]).type(self.dtype)
        VGG19 = vgg19(pretrained=True)
        self.VGG19_AC = VGG_Activations(VGG19,
                                        [1, 6, 11, 20, 29]).type(self.dtype)
Esempio n. 2
0
    def __init__(self, feed_forward=True):
        super(LossEG, self).__init__()

        self.VGG_FACE_AC = VGG_Activations(vgg_face(pretrained=True),
                                           [1, 6, 11, 18, 25])
        self.VGG19_AC = VGG_Activations(vgg19(pretrained=True),
                                        [1, 6, 11, 20, 29])

        self.match_loss = not feed_forward
Esempio n. 3
0
    def __init__(self, device, feed_forward=True):
        super(LossEG, self).__init__()
        self.dtype = torch.FloatTensor if device == 'cpu' else torch.cuda.FloatTensor

        self.VGG_FACE_AC = VGG_Activations(vgg_face(pretrained=True),
                                           [1, 6, 11, 18, 25]).type(self.dtype)
        self.VGG19_AC = VGG_Activations(vgg19(pretrained=True),
                                        [1, 6, 11, 20, 29]).type(self.dtype)

        self.match_loss = not feed_forward
Esempio n. 4
0
    def __init__(self, feed_forward=True):
        super(LossEG, self).__init__()

        self.VGG_FACE_AC = VGG_Activations(vgg_face(pretrained=True), [1, 6, 11, 18, 25])
        self.VGG19_AC = VGG_Activations(vgg19(pretrained=True), [1, 6, 11, 20, 29])

        self.IMG_NET_MEAN = torch.Tensor([0.485, 0.456, 0.406]).reshape([1, 3, 1, 1])
        self.IMG_NET_STD = torch.Tensor([0.229, 0.224, 0.225]).reshape([1, 3, 1, 1])

        self.match_loss = not feed_forward
Esempio n. 5
0
    def __init__(self, feed_forward=True, gpu=None):
        super(LossEG, self).__init__()

        self.VGG19_AC = VGG_Activations(vgg19(pretrained=True),
                                        [1, 6, 11, 20, 29])

        self.match_loss = not feed_forward
        self.gpu = gpu
        if gpu is not None:
            self.cuda(gpu)
Esempio n. 6
0
    def __init__(self, feed_forward=True, gpu=None):
        super(LossEG, self).__init__()

        self.VGG_FACE_AC = VGG_Activations(vgg_face(pretrained=True),
                                           [1, 6, 11, 18, 25])

        # self.match_loss = not feed_forward
        self.gpu = gpu
        if gpu is not None:
            self.cuda(gpu)