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()
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()
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()
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()
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()
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()
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()