Esempio n. 1
0
    def __init__(self, num_channel=256):
        super(BigBaseline_show, self).__init__()
        self.feature_extractor = make_residual_block(blocknum=5,
                                                     input_channel=3,
                                                     output_channel=64)

        #referenced by EDVR paper implementation code
        #https://github.com/xinntao/EDVR/blob/master/basicsr/models/archs/edvr_arch.py line 251
        self.downsampling_network = make_downsampling_network(layernum=2,
                                                              in_channels=3,
                                                              out_channels=256)
        self.lrfeature_scaler1 = nn.Conv2d(in_channels=3,
                                           out_channels=64,
                                           kernel_size=3,
                                           padding=1,
                                           bias=False)
        self.lrfeature_scaler2 = nn.Conv2d(in_channels=64,
                                           out_channels=256,
                                           kernel_size=3,
                                           padding=1,
                                           bias=False)
        self.feature_extractor = make_residual_block(blocknum=5,
                                                     input_channel=256,
                                                     output_channel=256)
        self.SSEN_Network = SSEN_show(in_channels=num_channel)

        self.preprocessing_residual_block = nn.Conv2d(in_channels=512,
                                                      out_channels=256,
                                                      kernel_size=1,
                                                      bias=False)
        self.residual_blocks = make_residual_block(blocknum=32,
                                                   input_channel=256,
                                                   output_channel=256)

        self.upscaling_4x = nn.Sequential(
            nn.Conv2d(in_channels=num_channel,
                      out_channels=4 * num_channel,
                      kernel_size=3,
                      padding=1,
                      bias=False),
            nn.PixelShuffle(2),
            nn.Conv2d(in_channels=num_channel,
                      out_channels=4 * num_channel,
                      kernel_size=3,
                      padding=1,
                      bias=False),
            nn.PixelShuffle(2),
        )

        self.outconv = nn.Conv2d(in_channels=num_channel,
                                 out_channels=3,
                                 kernel_size=3,
                                 padding=1,
                                 bias=False)
Esempio n. 2
0
    def __init__(self, ):
        super(EDSR_show, self).__init__()
        self.relu = nn.ReLU(True)

        self.mhead = nn.Conv2d(in_channels=128,
                               out_channels=64,
                               kernel_size=3,
                               padding=1,
                               bias=True)
        self.body = make_residual_block(blocknum=16,
                                        input_channel=64,
                                        output_channel=64)
        # define tail module
        m_tail = [
            nn.Conv2d(in_channels=64,
                      out_channels=4 * 64,
                      kernel_size=3,
                      padding=1,
                      bias=True),
            nn.PixelShuffle(2),
            nn.Conv2d(in_channels=64,
                      out_channels=3,
                      kernel_size=3,
                      padding=1,
                      bias=True)
        ]
        self.tail = nn.Sequential(*m_tail)
Esempio n. 3
0
    def __init__(self, ):
        super(EDSR, self).__init__()
        self.relu = nn.ReLU(True)

        # self.sub_mean = common.MeanShift(args.rgb_range)
        #   self.add_mean = common.MeanShift(args.rgb_range, sign=1)

        # define head module
        #m_head = [nn.Conv2d(in_channels=3, out_channels=64,kernel_size=3,padding=1, bias=True)]
        self.mhead = nn.Conv2d(in_channels=128,
                               out_channels=64,
                               kernel_size=3,
                               padding=1,
                               bias=True)
        # define body module
        """
        m_body = [
            common.ResBlock(
                conv, n_feats, kernel_size, act=act, res_scale=args.res_scale
            ) for _ in range(n_resblocks)
        ]
        
        m_body.append(conv(n_feats, n_feats, kernel_size))
        """
        self.body = make_residual_block(blocknum=16,
                                        input_channel=64,
                                        output_channel=64)
        # define tail module
        """
        m_tail = [
            common.Upsampler(conv, scale, n_feats, act=False),
            conv(n_feats, args.n_colors, kernel_size)
        ]
        """

        m_tail = [
            nn.Conv2d(in_channels=64,
                      out_channels=4 * 64,
                      kernel_size=3,
                      padding=1,
                      bias=True),
            nn.PixelShuffle(2),
            nn.Conv2d(in_channels=64,
                      out_channels=3,
                      kernel_size=3,
                      padding=1,
                      bias=True),
            nn.PixelShuffle(2),
            nn.Conv2d(in_channels=64,
                      out_channels=3,
                      kernel_size=3,
                      padding=1,
                      bias=True)
        ]

        #self.head = nn.Sequential(*m_head)
        self.tail = nn.Sequential(*m_tail)