def __init__(self, args): super(MultiLevelWCT, self).__init__() self.svd_device = torch.device('cpu') self.cnn_device = args.device self.alpha = args.alpha self.beta = args.beta if args.mask: self.mask_mode = True self.mask = Image.open(args.mask).convert('1') else: self.mask_mode = False self.mask = None self.e1 = Encoder(1) self.e2 = Encoder(2) self.e3 = Encoder(3) self.e4 = Encoder(4) self.e5 = Encoder(5) self.encoders = [self.e5, self.e4, self.e3, self.e2, self.e1] self.d1 = Decoder(1) self.d2 = Decoder(2) self.d3 = Decoder(3) self.d4 = Decoder(4) self.d5 = Decoder(5) self.decoders = [self.d5, self.d4, self.d3, self.d2, self.d1]
def __init__(self, args): super(SingleLevelWCT, self).__init__() # ss('in singlelevelwct init') self.svd_device = torch.device( 'cpu' ) # on average svd takes 4604ms on cpu vs gpu 5312ms on a 512x512 content/591x800 style (comprehensive of data transferring) self.cnn_device = args.device self.alpha = args.alpha self.beta = args.beta # ss('in singlelevelwct init') self.mask_mode = False self.mask = None self.e5 = Encoder(5) self.encoders = [self.e5] self.d5 = Decoder(5) self.decoders = [self.d5]
def __init__(self, args): super(SingleLevelWCT, self).__init__() self.svd_device = torch.device('cpu') # on average svd takes 4604ms on cpu vs gpu 5312ms on a 512x512 content/591x800 style (comprehensive of data transferring) self.cnn_device = args.device self.alpha = args.alpha self.beta = args.beta if args.mask: self.mask_mode = True self.mask = Image.open(args.mask).convert('1') else: self.mask_mode = False self.mask = None self.e5 = Encoder(5) self.encoders = [self.e5] self.d5 = Decoder(5) self.decoders = [self.d5]