Beispiel #1
0
    def __init__(self):
        super(Resnet50_AVG, self).__init__()

        self.base = nn.Sequential(
            OrderedDict(
                list(models.resnet50(pretrained=True).named_children())[:-2]))
        self.pool = torch.nn.AdaptiveAvgPool2d((1, 1))
        self.norm = L2N()
Beispiel #2
0
    def __init__(self):
        super(Resnet50_RMAC, self).__init__()
        self.base = nn.Sequential(
            OrderedDict(
                list(models.resnet50(pretrained=True).named_children())[:-2]))

        self.pool = RMAC()
        self.norm = L2N()
Beispiel #3
0
    def __init__(self):
        super(DenseNet_AVG, self).__init__()

        self.base = nn.Sequential(
            *list(models.densenet121(pretrained=True).features.children()),
            nn.ReLU(inplace=True))
        self.pool = torch.nn.AdaptiveAvgPool2d((1, 1))
        self.norm = L2N()
Beispiel #4
0
    def __init__(self):
        super(DenseNet_RMAC, self).__init__()

        self.base = nn.Sequential(
            *list(models.densenet121(pretrained=True).features.children()),
            nn.ReLU(inplace=True))
        self.pool = RMAC()
        self.norm = L2N()
Beispiel #5
0
 def __init__(self):
     super(MobileNet_GeM, self).__init__()
     self.base = nn.Sequential(
         OrderedDict([
             *list(
                 models.mobilenet_v2(
                     pretrained=True).features.named_children())
         ]))
     self.pool = GeM()
     self.norm = L2N()
Beispiel #6
0
 def __init__(self):
     super(MobileNet_AVG, self).__init__()
     self.base = nn.Sequential(
         OrderedDict([
             *list(
                 models.mobilenet_v2(
                     pretrained=True).features.named_children())
         ]))
     self.pool = torch.nn.AdaptiveAvgPool2d((1, 1))
     self.norm = L2N()
Beispiel #7
0
 def __init__(self):
     super(DenseNet_GeM, self).__init__()
     self.base = nn.Sequential(
         OrderedDict([
             *list(
                 models.densenet121(
                     pretrained=True).features.named_children())
         ] + [('relu', nn.ReLU(inplace=True))]))
     self.pool = GeM()
     self.norm = L2N()
Beispiel #8
0
 def __init__(self):
     super(Segment_Maxpooling, self).__init__()
     self.pool = torch.nn.AdaptiveAvgPool1d(1)
     self.norm = L2N()