Beispiel #1
0
 def __init__(self, batchNorm=False, other={}): 
     super(Regressor, self).__init__()
     self.other   = other
     self.deconv1 = model_utils.conv(batchNorm, 128, 128,  k=3, stride=1, pad=1)
     self.deconv2 = model_utils.conv(batchNorm, 128, 128,  k=3, stride=1, pad=1)
     self.deconv3 = model_utils.deconv(128, 64)
     self.est_normal= self._make_output(64, 3, k=3, stride=1, pad=1)
     self.other   = other
 def __init__(self, conv_dim=64, init_zero_weights=False):
     super(CycleGenerator, self).__init__()
     # Define the encoder part of the generator (that extracts features from the input image)
     self.conv1 = conv(3, conv_dim, 5, init_zero_weights=init_zero_weights)
     self.conv2 = conv(conv_dim, conv_dim * 2, 5)
     # Define the transformation part of the generator
     self.resnet_block = ResnetBlock(conv_dim * 2)
     # Define the decoder part of the generator (that builds up the output image from features)
     self.upconv1 = upconv(conv_dim * 2, conv_dim, 5)
     self.upconv2 = upconv(conv_dim, 3, 5, batch_norm=False)
Beispiel #3
0
 def __init__(self, batchNorm, c_in, c_out=256):
     super(FeatExtractor, self).__init__()
     self.conv1 = model_utils.conv(batchNorm, c_in, 64,    k=3, stride=2, pad=1)
     self.conv2 = model_utils.conv(batchNorm, 64,   128,   k=3, stride=2, pad=1)
     self.conv3 = model_utils.conv(batchNorm, 128,  128,   k=3, stride=1, pad=1)
     self.conv4 = model_utils.conv(batchNorm, 128,  128,   k=3, stride=2, pad=1)
     self.conv5 = model_utils.conv(batchNorm, 128,  128,   k=3, stride=1, pad=1)
     self.conv6 = model_utils.conv(batchNorm, 128,  256,   k=3, stride=2, pad=1)
     self.conv7 = model_utils.conv(batchNorm, 256,  256,   k=3, stride=1, pad=1)
Beispiel #4
0
 def __init__(self, batchNorm=False, c_in=3, other={}):
     super(FeatExtractor, self).__init__()
     self.other = other
     self.conv1 = model_utils.conv(batchNorm,
                                   c_in,
                                   64,
                                   k=3,
                                   stride=1,
                                   pad=1)
     self.conv2 = model_utils.conv(batchNorm, 64, 128, k=3, stride=2, pad=1)
     self.conv3 = model_utils.conv(batchNorm,
                                   128,
                                   128,
                                   k=3,
                                   stride=1,
                                   pad=1)
     self.conv4 = model_utils.conv(batchNorm,
                                   128,
                                   256,
                                   k=3,
                                   stride=2,
                                   pad=1)
     self.conv5 = model_utils.conv(batchNorm,
                                   256,
                                   256,
                                   k=3,
                                   stride=1,
                                   pad=1)
     self.conv6 = model_utils.deconv(256, 128)
     self.conv7 = model_utils.conv(batchNorm,
                                   128,
                                   128,
                                   k=3,
                                   stride=1,
                                   pad=1)
Beispiel #5
0
    def __init__(self, batchNorm, c_in, other):
        super(Classifier, self).__init__()
        self.conv1 = model_utils.conv(batchNorm, 512,  256, k=3, stride=1, pad=1)
        self.conv2 = model_utils.conv(batchNorm, 256,  256, k=3, stride=2, pad=1)
        self.conv3 = model_utils.conv(batchNorm, 256,  256, k=3, stride=2, pad=1)
        self.conv4 = model_utils.conv(batchNorm, 256,  256, k=3, stride=2, pad=1)
        self.other = other
        
        self.dir_x_est = nn.Sequential(
                    model_utils.conv(batchNorm, 256, 64,  k=1, stride=1, pad=0),
                    model_utils.outputConv(64, other['dirs_cls'], k=1, stride=1, pad=0))

        self.dir_y_est = nn.Sequential(
                    model_utils.conv(batchNorm, 256, 64,  k=1, stride=1, pad=0),
                    model_utils.outputConv(64, other['dirs_cls'], k=1, stride=1, pad=0))

        self.int_est = nn.Sequential(
                    model_utils.conv(batchNorm, 256, 64,  k=1, stride=1, pad=0),
                    model_utils.outputConv(64, other['ints_cls'], k=1, stride=1, pad=0))