def initialize_networks(self):
        netD = networks.define_D2(self.opt) if self.opt.isTrain else None
        if self.opt.isTrain and self.opt.which_iter_D2>0:
            print_network(netD)
            netD = util.load_network(netD, 'D2', self.opt.which_iter_D2 , self.opt)

        return netD
示例#2
0
 def initialize_networks(self):
     if 'cityscapes' in self.opt.dataset:
         aspect_ratio = 2
     else:
         aspect_ratio = 1
     generator = ProGANGenerator(max_dim=self.opt.max_dim, rgb=self.opt.rgb, aspect_ratio=aspect_ratio).cuda()
     discriminator = ProGANDiscriminator(max_dim=self.opt.max_dim, rgb=self.opt.rgb, aspect_ratio=aspect_ratio).cuda()
     print_network(generator)
     print_network(discriminator)
     return generator, discriminator
示例#3
0
    def initialize_networks(self, D_inputs=0):
        if 'cityscapes' in self.opt.dataset:
            aspect_ratio = 2
        else:
            aspect_ratio = 1
        if not D_inputs:
            D_inputs = self.opt.num_semantics

        generator = ProGANGenerator(max_dim=self.opt.max_dim, rgb=self.opt.rgb, num_semantics=self.opt.num_semantics, T=self.opt.T, aspect_ratio=aspect_ratio).cuda()
        discriminator = ProGANDiscriminator(max_dim=self.opt.max_dim, rgb=self.opt.rgb, num_semantics=D_inputs, aspect_ratio=aspect_ratio).cuda()
        print_network(generator)
        print_network(discriminator)
        return generator, discriminator