def __init__(self,
              num_classes,
              encoder=None):  # use encoder to pass pretrained encoder
     super().__init__()
     if encoder is None:
         self.encoder = Encoder(num_classes)
     else:
         self.encoder = encoder
     self.decoder = erfnet.Decoder(num_classes)
示例#2
0
    def __init__(self, num_classes, encoder=None):
        super().__init__()

        print('Creating branched erfnet with {} classes'.format(num_classes))

        if (encoder is None):
            self.encoder = erfnet.Encoder(sum(num_classes))
        else:
            self.encoder = encoder

        self.decoders = nn.ModuleList()
        for n in num_classes:
            self.decoders.append(erfnet.Decoder(n))
示例#3
0
 def __init__(self, num_classes, encoder=None):
     super().__init__(num_classes, encoder)
     self.cls_conv = erfnet.Decoder(num_classes[1] + 1)
     self.seg = False
     self.init_output()
 def __init__(self, num_classes):
     super().__init__(num_classes,
                      encoder=LabelEncoder(num_classes=sum(num_classes)))
     self.cls_conv = erfnet.Decoder(num_classes[1] + 1)
     self.seg = False