コード例 #1
0
    def eval_initialize(self, opt):
        BaseModel.eval_initialize(self, opt)

        args = {'scale': opt.sr_factor, 'n_feats': 256, 'n_resblocks': 32, 'res_scale': 0.1, 'n_colors': 3,
                'rgb_range': opt.rgb_range}
        self.model = EDSR(args).to(self.device)
        self.model = nn.DataParallel(self.model, opt.gpu_ids)
コード例 #2
0
ファイル: RCAN.py プロジェクト: luohongming/SR_baseline
 def eval_initialize(self, opt):
     BaseModel.eval_initialize(self, opt)
     args = {'scale': opt.sr_factor, 'n_resgroups': 10, 'n_feats': 64, 'n_resblocks': 20, 'res_scale': 1,
             'n_colors': 3,
             'reduction': 16, 'rgb_range': opt.rgb_range}
     self.model = RCAN(args).to(self.device)
     self.model = nn.DataParallel(self.model, opt.gpu_ids)
コード例 #3
0
    def eval_initialize(self, opt):
        BaseModel.eval_initialize(self, opt)
        kernel_size = 3
        n_colors = opt.n_colors

        self.model = NonLocalModule(kernel_size, n_colors, self.device)
        self.model = nn.DataParallel(self.model, opt.gpu_ids)
        self.model.to(self.device)
コード例 #4
0
ファイル: RDN.py プロジェクト: luohongming/SR_baseline
    def eval_initialize(self, opt):
        BaseModel.eval_initialize(self, opt)

        args = {
            'scale': opt.sr_factor,
            'G0': 64,
            'RDNkSize': 3,
            'RDNconfig': 'B',
            'n_colors': 3
        }
        self.model = RDN(args).to(self.device)
        self.model = nn.DataParallel(self.model, opt.gpu_ids)
コード例 #5
0
ファイル: PSIARRE.py プロジェクト: tamwaiban/CISR_PSI
    def eval_initialize(self, opt):
        BaseModel.eval_initialize(self, opt)
        SR_args = {
            'scale': opt.sr_factor,
            'n_feats': opt.n_feats,
            'n_resblocks': opt.n_resblocks,
            'n_colors': opt.n_colors,
            'main_model': opt.main_model,
            'recur_step': opt.recur_step,
            'res_scale': opt.res_scale,
            'device': self.device,
            'n_resgroups1': opt.n_resgroups1,
            'n_resgroups2': opt.n_resgroups2,
            'rgb_range': opt.rgb_range
        }
        self.sr_factor = opt.sr_factor
        self.model = PSIARRENet(SR_args)
        self.model = nn.DataParallel(self.model, device_ids=opt.gpu_ids)
        self.model.to(self.device)

        if opt.n_resgroups1 == 2:
            self.tiny = True
        else:
            self.tiny = False