Esempio n. 1
0
    def __init__(self,args):
        super(WCT, self).__init__()
        # load pre-trained network
        vgg1 = load_lua(args.vgg1,long_size=8)
        decoder1_torch = load_lua(args.decoder1,long_size=8)
        vgg2 = load_lua(args.vgg2,long_size=8)
        decoder2_torch = load_lua(args.decoder2,long_size=8)
        vgg3 = load_lua(args.vgg3,long_size=8)
        decoder3_torch = load_lua(args.decoder3,long_size=8)
        vgg4 = load_lua(args.vgg4,long_size=8)
        decoder4_torch = load_lua(args.decoder4,long_size=8)
        vgg5 = load_lua(args.vgg5,long_size=8)
        decoder5_torch = load_lua(args.decoder5,long_size=8)


        self.e1 = encoder1(vgg1)
        self.d1 = decoder1(decoder1_torch)
        self.e2 = encoder2(vgg2)
        self.d2 = decoder2(decoder2_torch)
        self.e3 = encoder3(vgg3)
        self.d3 = decoder3(decoder3_torch)
        self.e4 = encoder4(vgg4)
        self.d4 = decoder4(decoder4_torch)
        self.e5 = encoder5(vgg5)
        self.d5 = decoder5(decoder5_torch)
Esempio n. 2
0
File: util.py Progetto: czczup/URST
    def __init__(self,args):
        super(WCT, self).__init__()
        # load pre-trained network
        vgg1 = torchfile.load(args.vgg1)
        decoder1_torch = torchfile.load(args.decoder1)
        vgg2 = torchfile.load(args.vgg2)
        decoder2_torch = torchfile.load(args.decoder2)
        vgg3 = torchfile.load(args.vgg3)
        decoder3_torch = torchfile.load(args.decoder3)
        vgg4 = torchfile.load(args.vgg4)
        decoder4_torch = torchfile.load(args.decoder4)
        vgg5 = torchfile.load(args.vgg5)
        decoder5_torch = torchfile.load(args.decoder5)

        
        self.e1 = encoder1(vgg1)
        self.d1 = decoder1(decoder1_torch)
        self.e2 = encoder2(vgg2)
        self.d2 = decoder2(decoder2_torch)
        self.e3 = encoder3(vgg3)
        self.d3 = decoder3(decoder3_torch)
        self.e4 = encoder4(vgg4)
        self.d4 = decoder4(decoder4_torch)
        self.e5 = encoder5(vgg5)
        self.d5 = decoder5(decoder5_torch)
        
        self.wct1 = ThumbWhitenColorTransform()
        self.wct2 = ThumbWhitenColorTransform()
        self.wct3 = ThumbWhitenColorTransform()
        self.wct4 = ThumbWhitenColorTransform()
        self.wct5 = ThumbWhitenColorTransform()
    def __init__(self, args):
        super(WCT, self).__init__()
        # load pre-trained network
        vgg1 = load_lua(args.vgg1)
        decoder1_torch = load_lua(args.decoder1)
        vgg2 = load_lua(args.vgg2)
        decoder2_torch = load_lua(args.decoder2)
        vgg3 = load_lua(args.vgg3)
        decoder3_torch = load_lua(args.decoder3)
        vgg4 = load_lua(args.vgg4)
        decoder4_torch = load_lua(args.decoder4)
        vgg5 = load_lua(args.vgg5)
        decoder5_torch = load_lua(args.decoder5)

        self.e1 = encoder1(vgg1)
        self.d1 = decoder1(decoder1_torch)
        self.e2 = encoder2(vgg2)
        self.d2 = decoder2(decoder2_torch)
        self.e3 = encoder3(vgg3)
        self.d3 = decoder3(decoder3_torch)
        self.e4 = encoder4(vgg4)
        self.d4 = decoder4(decoder4_torch)
        self.e5 = encoder5(vgg5)
        self.d5 = decoder5(decoder5_torch)

        self.args = args
Esempio n. 4
0
    def __init__(self, args):
        super(WCT, self).__init__()
        # 加载预训练的vgg:
        vgg1 = load(args.vgg1, force_8bytes_long=True)
        # vgg1 = vgg1.eval()
        decoder1_torch = load(args.decoder1, force_8bytes_long=True)
        vgg2 = load(args.vgg2, force_8bytes_long=True)
        decoder2_torch = load(args.decoder2, force_8bytes_long=True)
        vgg3 = load(args.vgg3, force_8bytes_long=True)
        decoder3_torch = load(args.decoder3, force_8bytes_long=True)
        vgg4 = load(args.vgg4, force_8bytes_long=True)
        decoder4_torch = load(args.decoder4, force_8bytes_long=True)
        vgg5 = load(args.vgg5, force_8bytes_long=True)
        decoder5_torch = load(args.decoder5, force_8bytes_long=True)

        self.e1 = encoder1(vgg1)
        self.d1 = decoder1(decoder1_torch)
        self.e2 = encoder2(vgg2)
        self.d2 = decoder2(decoder2_torch)
        self.e3 = encoder3(vgg3)
        self.d3 = decoder3(decoder3_torch)
        self.e4 = encoder4(vgg4)
        self.d4 = decoder4(decoder4_torch)
        self.e5 = encoder5(vgg5)
        self.d5 = decoder5(decoder5_torch)
Esempio n. 5
0
    def __init__(self, args):
        super(WCT, self).__init__()
        # load pre-trained network
        vgg1 = load(
            args.vgg1,
            force_8bytes_long=True)  # windows下需要参数:force_8bytes_long=True
        decoder1_torch = load(args.decoder1, force_8bytes_long=True)
        vgg2 = load(args.vgg2, force_8bytes_long=True)
        decoder2_torch = load(args.decoder2, force_8bytes_long=True)
        vgg3 = load(args.vgg3, force_8bytes_long=True)
        decoder3_torch = load(args.decoder3, force_8bytes_long=True)
        vgg4 = load(args.vgg4, force_8bytes_long=True)
        decoder4_torch = load(args.decoder4, force_8bytes_long=True)
        vgg5 = load(args.vgg5, force_8bytes_long=True)
        decoder5_torch = load(args.decoder5, force_8bytes_long=True)

        self.e1 = encoder1(vgg1)
        self.d1 = decoder1(decoder1_torch)
        self.e2 = encoder2(vgg2)
        self.d2 = decoder2(decoder2_torch)
        self.e3 = encoder3(vgg3)
        self.d3 = decoder3(decoder3_torch)
        self.e4 = encoder4(vgg4)
        self.d4 = decoder4(decoder4_torch)
        self.e5 = encoder5(vgg5)
        self.d5 = decoder5(decoder5_torch)
Esempio n. 6
0
 def __init__(self, vgg1, decoder1_torch, vgg2, decoder2_torch, vgg3,
              decoder3_torch, vgg4, decoder4_torch, vgg5, decoder5_torch):
     super(WCT, self).__init__()
     # load pre-trained network
     self.e1 = encoder1(vgg1)
     self.d1 = decoder1(decoder1_torch)
     self.e2 = encoder2(vgg2)
     self.d2 = decoder2(decoder2_torch)
     self.e3 = encoder3(vgg3)
     self.d3 = decoder3(decoder3_torch)
     self.e4 = encoder4(vgg4)
     self.d4 = decoder4(decoder4_torch)
     self.e5 = encoder5(vgg5)
     self.d5 = decoder5(decoder5_torch)
Esempio n. 7
0
def loadModel(args):

    # load pre-trained network
    vgg1 = load_lua(args.vgg1)
    decoder1_torch = load_lua(args.decoder1)
    vgg2 = load_lua(args.vgg2)
    decoder2_torch = load_lua(args.decoder2)
    vgg3 = load_lua(args.vgg3)
    decoder3_torch = load_lua(args.decoder3)
    vgg4 = load_lua(args.vgg4)
    decoder4_torch = load_lua(args.decoder4)
    vgg5 = load_lua(args.vgg5)
    decoder5_torch = load_lua(args.decoder5)

    e1 = encoder1(vgg1)
    d1 = decoder1(decoder1_torch)
    e2 = encoder2(vgg2)
    d2 = decoder2(decoder2_torch)
    e3 = encoder3(vgg3)
    d3 = decoder3(decoder3_torch)
    e4 = encoder4(vgg4)
    d4 = decoder4(decoder4_torch)
    e5 = encoder5(vgg5)
    d5 = decoder5(decoder5_torch)
    if (args.cuda):
        e1.cuda()
        e2.cuda()
        e3.cuda()
        e4.cuda()
        e5.cuda()
        d1.cuda()
        d2.cuda()
        d3.cuda()
        d4.cuda()
        d5.cuda()

    # save some space
    del vgg1
    del decoder1_torch
    del vgg2
    del decoder2_torch
    del vgg3
    del decoder3_torch
    del vgg4
    del decoder4_torch
    del vgg5
    del decoder5_torch
    return e1, d1, e2, d2, e3, d3, e4, d4, e5, d5