|
|
@ -845,77 +845,72 @@ def _create_resnet(variant, pretrained=False, **kwargs):
|
|
|
|
def resnet10t(pretrained=False, **kwargs):
|
|
|
|
def resnet10t(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-10-T model.
|
|
|
|
"""Constructs a ResNet-10-T model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(block=BasicBlock, layers=[1, 1, 1, 1], stem_width=32, stem_type='deep_tiered', avg_down=True)
|
|
|
|
block=BasicBlock, layers=[1, 1, 1, 1], stem_width=32, stem_type='deep_tiered', avg_down=True, **kwargs)
|
|
|
|
return _create_resnet('resnet10t', pretrained, **dict(model_args, **kwargs))
|
|
|
|
return _create_resnet('resnet10t', pretrained, **model_args)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnet14t(pretrained=False, **kwargs):
|
|
|
|
def resnet14t(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-14-T model.
|
|
|
|
"""Constructs a ResNet-14-T model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(block=Bottleneck, layers=[1, 1, 1, 1], stem_width=32, stem_type='deep_tiered', avg_down=True)
|
|
|
|
block=Bottleneck, layers=[1, 1, 1, 1], stem_width=32, stem_type='deep_tiered', avg_down=True, **kwargs)
|
|
|
|
return _create_resnet('resnet14t', pretrained, **dict(model_args, **kwargs))
|
|
|
|
return _create_resnet('resnet14t', pretrained, **model_args)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnet18(pretrained=False, **kwargs):
|
|
|
|
def resnet18(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-18 model.
|
|
|
|
"""Constructs a ResNet-18 model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=BasicBlock, layers=[2, 2, 2, 2], **kwargs)
|
|
|
|
model_args = dict(block=BasicBlock, layers=[2, 2, 2, 2])
|
|
|
|
return _create_resnet('resnet18', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnet18', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnet18d(pretrained=False, **kwargs):
|
|
|
|
def resnet18d(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-18-D model.
|
|
|
|
"""Constructs a ResNet-18-D model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(block=BasicBlock, layers=[2, 2, 2, 2], stem_width=32, stem_type='deep', avg_down=True)
|
|
|
|
block=BasicBlock, layers=[2, 2, 2, 2], stem_width=32, stem_type='deep', avg_down=True, **kwargs)
|
|
|
|
return _create_resnet('resnet18d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
return _create_resnet('resnet18d', pretrained, **model_args)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnet34(pretrained=False, **kwargs):
|
|
|
|
def resnet34(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-34 model.
|
|
|
|
"""Constructs a ResNet-34 model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=BasicBlock, layers=[3, 4, 6, 3], **kwargs)
|
|
|
|
model_args = dict(block=BasicBlock, layers=[3, 4, 6, 3])
|
|
|
|
return _create_resnet('resnet34', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnet34', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnet34d(pretrained=False, **kwargs):
|
|
|
|
def resnet34d(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-34-D model.
|
|
|
|
"""Constructs a ResNet-34-D model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(block=BasicBlock, layers=[3, 4, 6, 3], stem_width=32, stem_type='deep', avg_down=True)
|
|
|
|
block=BasicBlock, layers=[3, 4, 6, 3], stem_width=32, stem_type='deep', avg_down=True, **kwargs)
|
|
|
|
return _create_resnet('resnet34d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
return _create_resnet('resnet34d', pretrained, **model_args)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnet26(pretrained=False, **kwargs):
|
|
|
|
def resnet26(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-26 model.
|
|
|
|
"""Constructs a ResNet-26 model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[2, 2, 2, 2], **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[2, 2, 2, 2])
|
|
|
|
return _create_resnet('resnet26', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnet26', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnet26t(pretrained=False, **kwargs):
|
|
|
|
def resnet26t(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-26-T model.
|
|
|
|
"""Constructs a ResNet-26-T model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(block=Bottleneck, layers=[2, 2, 2, 2], stem_width=32, stem_type='deep_tiered', avg_down=True)
|
|
|
|
block=Bottleneck, layers=[2, 2, 2, 2], stem_width=32, stem_type='deep_tiered', avg_down=True, **kwargs)
|
|
|
|
return _create_resnet('resnet26t', pretrained, **dict(model_args, **kwargs))
|
|
|
|
return _create_resnet('resnet26t', pretrained, **model_args)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnet26d(pretrained=False, **kwargs):
|
|
|
|
def resnet26d(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-26-D model.
|
|
|
|
"""Constructs a ResNet-26-D model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[2, 2, 2, 2], stem_width=32, stem_type='deep', avg_down=True, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[2, 2, 2, 2], stem_width=32, stem_type='deep', avg_down=True)
|
|
|
|
return _create_resnet('resnet26d', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnet26d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -923,83 +918,79 @@ def resnet50(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-50 model.
|
|
|
|
"""Constructs a ResNet-50 model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], **kwargs)
|
|
|
|
return _create_resnet('resnet50', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnet50', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnet50d(pretrained=False, **kwargs) -> ResNet:
|
|
|
|
def resnet50d(pretrained=False, **kwargs) -> ResNet:
|
|
|
|
"""Constructs a ResNet-50-D model.
|
|
|
|
"""Constructs a ResNet-50-D model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], stem_width=32, stem_type='deep', avg_down=True)
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], stem_width=32, stem_type='deep', avg_down=True, **kwargs)
|
|
|
|
return _create_resnet('resnet50d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
return _create_resnet('resnet50d', pretrained, **model_args)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnet50t(pretrained=False, **kwargs):
|
|
|
|
def resnet50t(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-50-T model.
|
|
|
|
"""Constructs a ResNet-50-T model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], stem_width=32, stem_type='deep_tiered', avg_down=True)
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], stem_width=32, stem_type='deep_tiered', avg_down=True, **kwargs)
|
|
|
|
return _create_resnet('resnet50t', pretrained, **dict(model_args, **kwargs))
|
|
|
|
return _create_resnet('resnet50t', pretrained, **model_args)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnet101(pretrained=False, **kwargs):
|
|
|
|
def resnet101(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-101 model.
|
|
|
|
"""Constructs a ResNet-101 model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3])
|
|
|
|
return _create_resnet('resnet101', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnet101', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnet101d(pretrained=False, **kwargs):
|
|
|
|
def resnet101d(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-101-D model.
|
|
|
|
"""Constructs a ResNet-101-D model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], stem_width=32, stem_type='deep', avg_down=True, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], stem_width=32, stem_type='deep', avg_down=True)
|
|
|
|
return _create_resnet('resnet101d', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnet101d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnet152(pretrained=False, **kwargs):
|
|
|
|
def resnet152(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-152 model.
|
|
|
|
"""Constructs a ResNet-152 model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 8, 36, 3], **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 8, 36, 3])
|
|
|
|
return _create_resnet('resnet152', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnet152', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnet152d(pretrained=False, **kwargs):
|
|
|
|
def resnet152d(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-152-D model.
|
|
|
|
"""Constructs a ResNet-152-D model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 8, 36, 3], stem_width=32, stem_type='deep', avg_down=True)
|
|
|
|
block=Bottleneck, layers=[3, 8, 36, 3], stem_width=32, stem_type='deep', avg_down=True, **kwargs)
|
|
|
|
return _create_resnet('resnet152d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
return _create_resnet('resnet152d', pretrained, **model_args)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnet200(pretrained=False, **kwargs):
|
|
|
|
def resnet200(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-200 model.
|
|
|
|
"""Constructs a ResNet-200 model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 24, 36, 3], **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 24, 36, 3])
|
|
|
|
return _create_resnet('resnet200', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnet200', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnet200d(pretrained=False, **kwargs):
|
|
|
|
def resnet200d(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-200-D model.
|
|
|
|
"""Constructs a ResNet-200-D model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 24, 36, 3], stem_width=32, stem_type='deep', avg_down=True)
|
|
|
|
block=Bottleneck, layers=[3, 24, 36, 3], stem_width=32, stem_type='deep', avg_down=True, **kwargs)
|
|
|
|
return _create_resnet('resnet200d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
return _create_resnet('resnet200d', pretrained, **model_args)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def tv_resnet34(pretrained=False, **kwargs):
|
|
|
|
def tv_resnet34(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-34 model with original Torchvision weights.
|
|
|
|
"""Constructs a ResNet-34 model with original Torchvision weights.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=BasicBlock, layers=[3, 4, 6, 3], **kwargs)
|
|
|
|
model_args = dict(block=BasicBlock, layers=[3, 4, 6, 3])
|
|
|
|
return _create_resnet('tv_resnet34', pretrained, **model_args)
|
|
|
|
return _create_resnet('tv_resnet34', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1007,23 +998,23 @@ def tv_resnet50(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-50 model with original Torchvision weights.
|
|
|
|
"""Constructs a ResNet-50 model with original Torchvision weights.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], **kwargs)
|
|
|
|
return _create_resnet('tv_resnet50', pretrained, **model_args)
|
|
|
|
return _create_resnet('tv_resnet50', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def tv_resnet101(pretrained=False, **kwargs):
|
|
|
|
def tv_resnet101(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-101 model w/ Torchvision pretrained weights.
|
|
|
|
"""Constructs a ResNet-101 model w/ Torchvision pretrained weights.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3])
|
|
|
|
return _create_resnet('tv_resnet101', pretrained, **model_args)
|
|
|
|
return _create_resnet('tv_resnet101', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def tv_resnet152(pretrained=False, **kwargs):
|
|
|
|
def tv_resnet152(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-152 model w/ Torchvision pretrained weights.
|
|
|
|
"""Constructs a ResNet-152 model w/ Torchvision pretrained weights.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 8, 36, 3], **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 8, 36, 3])
|
|
|
|
return _create_resnet('tv_resnet152', pretrained, **model_args)
|
|
|
|
return _create_resnet('tv_resnet152', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1034,8 +1025,8 @@ def wide_resnet50_2(pretrained=False, **kwargs):
|
|
|
|
convolutions is the same, e.g. last block in ResNet-50 has 2048-512-2048
|
|
|
|
convolutions is the same, e.g. last block in ResNet-50 has 2048-512-2048
|
|
|
|
channels, and in Wide ResNet-50-2 has 2048-1024-2048.
|
|
|
|
channels, and in Wide ResNet-50-2 has 2048-1024-2048.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], base_width=128, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], base_width=128)
|
|
|
|
return _create_resnet('wide_resnet50_2', pretrained, **model_args)
|
|
|
|
return _create_resnet('wide_resnet50_2', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1045,8 +1036,8 @@ def wide_resnet101_2(pretrained=False, **kwargs):
|
|
|
|
which is twice larger in every block. The number of channels in outer 1x1
|
|
|
|
which is twice larger in every block. The number of channels in outer 1x1
|
|
|
|
convolutions is the same.
|
|
|
|
convolutions is the same.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], base_width=128, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], base_width=128)
|
|
|
|
return _create_resnet('wide_resnet101_2', pretrained, **model_args)
|
|
|
|
return _create_resnet('wide_resnet101_2', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1061,8 +1052,8 @@ def resnet50_gn(pretrained=False, **kwargs):
|
|
|
|
def resnext50_32x4d(pretrained=False, **kwargs):
|
|
|
|
def resnext50_32x4d(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNeXt50-32x4d model.
|
|
|
|
"""Constructs a ResNeXt50-32x4d model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], cardinality=32, base_width=4, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], cardinality=32, base_width=4)
|
|
|
|
return _create_resnet('resnext50_32x4d', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnext50_32x4d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1071,40 +1062,40 @@ def resnext50d_32x4d(pretrained=False, **kwargs):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], cardinality=32, base_width=4,
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], cardinality=32, base_width=4,
|
|
|
|
stem_width=32, stem_type='deep', avg_down=True, **kwargs)
|
|
|
|
stem_width=32, stem_type='deep', avg_down=True)
|
|
|
|
return _create_resnet('resnext50d_32x4d', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnext50d_32x4d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnext101_32x4d(pretrained=False, **kwargs):
|
|
|
|
def resnext101_32x4d(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNeXt-101 32x4d model.
|
|
|
|
"""Constructs a ResNeXt-101 32x4d model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=4, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=4)
|
|
|
|
return _create_resnet('resnext101_32x4d', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnext101_32x4d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnext101_32x8d(pretrained=False, **kwargs):
|
|
|
|
def resnext101_32x8d(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNeXt-101 32x8d model.
|
|
|
|
"""Constructs a ResNeXt-101 32x8d model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=8, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=8)
|
|
|
|
return _create_resnet('resnext101_32x8d', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnext101_32x8d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnext101_64x4d(pretrained=False, **kwargs):
|
|
|
|
def resnext101_64x4d(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNeXt101-64x4d model.
|
|
|
|
"""Constructs a ResNeXt101-64x4d model.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=64, base_width=4, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=64, base_width=4)
|
|
|
|
return _create_resnet('resnext101_64x4d', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnext101_64x4d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def tv_resnext50_32x4d(pretrained=False, **kwargs):
|
|
|
|
def tv_resnext50_32x4d(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNeXt50-32x4d model with original Torchvision weights.
|
|
|
|
"""Constructs a ResNeXt50-32x4d model with original Torchvision weights.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], cardinality=32, base_width=4, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], cardinality=32, base_width=4)
|
|
|
|
return _create_resnet('tv_resnext50_32x4d', pretrained, **model_args)
|
|
|
|
return _create_resnet('tv_resnext50_32x4d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1114,8 +1105,8 @@ def ig_resnext101_32x8d(pretrained=False, **kwargs):
|
|
|
|
`"Exploring the Limits of Weakly Supervised Pretraining" <https://arxiv.org/abs/1805.00932>`_
|
|
|
|
`"Exploring the Limits of Weakly Supervised Pretraining" <https://arxiv.org/abs/1805.00932>`_
|
|
|
|
Weights from https://pytorch.org/hub/facebookresearch_WSL-Images_resnext/
|
|
|
|
Weights from https://pytorch.org/hub/facebookresearch_WSL-Images_resnext/
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=8, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=8)
|
|
|
|
return _create_resnet('ig_resnext101_32x8d', pretrained, **model_args)
|
|
|
|
return _create_resnet('ig_resnext101_32x8d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1125,8 +1116,8 @@ def ig_resnext101_32x16d(pretrained=False, **kwargs):
|
|
|
|
`"Exploring the Limits of Weakly Supervised Pretraining" <https://arxiv.org/abs/1805.00932>`_
|
|
|
|
`"Exploring the Limits of Weakly Supervised Pretraining" <https://arxiv.org/abs/1805.00932>`_
|
|
|
|
Weights from https://pytorch.org/hub/facebookresearch_WSL-Images_resnext/
|
|
|
|
Weights from https://pytorch.org/hub/facebookresearch_WSL-Images_resnext/
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=16, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=16)
|
|
|
|
return _create_resnet('ig_resnext101_32x16d', pretrained, **model_args)
|
|
|
|
return _create_resnet('ig_resnext101_32x16d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1136,8 +1127,8 @@ def ig_resnext101_32x32d(pretrained=False, **kwargs):
|
|
|
|
`"Exploring the Limits of Weakly Supervised Pretraining" <https://arxiv.org/abs/1805.00932>`_
|
|
|
|
`"Exploring the Limits of Weakly Supervised Pretraining" <https://arxiv.org/abs/1805.00932>`_
|
|
|
|
Weights from https://pytorch.org/hub/facebookresearch_WSL-Images_resnext/
|
|
|
|
Weights from https://pytorch.org/hub/facebookresearch_WSL-Images_resnext/
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=32, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=32)
|
|
|
|
return _create_resnet('ig_resnext101_32x32d', pretrained, **model_args)
|
|
|
|
return _create_resnet('ig_resnext101_32x32d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1147,8 +1138,8 @@ def ig_resnext101_32x48d(pretrained=False, **kwargs):
|
|
|
|
`"Exploring the Limits of Weakly Supervised Pretraining" <https://arxiv.org/abs/1805.00932>`_
|
|
|
|
`"Exploring the Limits of Weakly Supervised Pretraining" <https://arxiv.org/abs/1805.00932>`_
|
|
|
|
Weights from https://pytorch.org/hub/facebookresearch_WSL-Images_resnext/
|
|
|
|
Weights from https://pytorch.org/hub/facebookresearch_WSL-Images_resnext/
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=48, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=48)
|
|
|
|
return _create_resnet('ig_resnext101_32x48d', pretrained, **model_args)
|
|
|
|
return _create_resnet('ig_resnext101_32x48d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1157,8 +1148,8 @@ def ssl_resnet18(pretrained=False, **kwargs):
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=BasicBlock, layers=[2, 2, 2, 2], **kwargs)
|
|
|
|
model_args = dict(block=BasicBlock, layers=[2, 2, 2, 2])
|
|
|
|
return _create_resnet('ssl_resnet18', pretrained, **model_args)
|
|
|
|
return _create_resnet('ssl_resnet18', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1168,7 +1159,7 @@ def ssl_resnet50(pretrained=False, **kwargs):
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], **kwargs)
|
|
|
|
return _create_resnet('ssl_resnet50', pretrained, **model_args)
|
|
|
|
return _create_resnet('ssl_resnet50', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1177,8 +1168,8 @@ def ssl_resnext50_32x4d(pretrained=False, **kwargs):
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], cardinality=32, base_width=4, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], cardinality=32, base_width=4)
|
|
|
|
return _create_resnet('ssl_resnext50_32x4d', pretrained, **model_args)
|
|
|
|
return _create_resnet('ssl_resnext50_32x4d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1187,8 +1178,8 @@ def ssl_resnext101_32x4d(pretrained=False, **kwargs):
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=4, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=4)
|
|
|
|
return _create_resnet('ssl_resnext101_32x4d', pretrained, **model_args)
|
|
|
|
return _create_resnet('ssl_resnext101_32x4d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1197,8 +1188,8 @@ def ssl_resnext101_32x8d(pretrained=False, **kwargs):
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=8, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=8)
|
|
|
|
return _create_resnet('ssl_resnext101_32x8d', pretrained, **model_args)
|
|
|
|
return _create_resnet('ssl_resnext101_32x8d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1207,8 +1198,8 @@ def ssl_resnext101_32x16d(pretrained=False, **kwargs):
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=16, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=16)
|
|
|
|
return _create_resnet('ssl_resnext101_32x16d', pretrained, **model_args)
|
|
|
|
return _create_resnet('ssl_resnext101_32x16d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1218,8 +1209,8 @@ def swsl_resnet18(pretrained=False, **kwargs):
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=BasicBlock, layers=[2, 2, 2, 2], **kwargs)
|
|
|
|
model_args = dict(block=BasicBlock, layers=[2, 2, 2, 2])
|
|
|
|
return _create_resnet('swsl_resnet18', pretrained, **model_args)
|
|
|
|
return _create_resnet('swsl_resnet18', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1230,7 +1221,7 @@ def swsl_resnet50(pretrained=False, **kwargs):
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], **kwargs)
|
|
|
|
return _create_resnet('swsl_resnet50', pretrained, **model_args)
|
|
|
|
return _create_resnet('swsl_resnet50', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1240,8 +1231,8 @@ def swsl_resnext50_32x4d(pretrained=False, **kwargs):
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], cardinality=32, base_width=4, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], cardinality=32, base_width=4)
|
|
|
|
return _create_resnet('swsl_resnext50_32x4d', pretrained, **model_args)
|
|
|
|
return _create_resnet('swsl_resnext50_32x4d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1251,8 +1242,8 @@ def swsl_resnext101_32x4d(pretrained=False, **kwargs):
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=4, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=4)
|
|
|
|
return _create_resnet('swsl_resnext101_32x4d', pretrained, **model_args)
|
|
|
|
return _create_resnet('swsl_resnext101_32x4d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1262,8 +1253,8 @@ def swsl_resnext101_32x8d(pretrained=False, **kwargs):
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=8, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=8)
|
|
|
|
return _create_resnet('swsl_resnext101_32x8d', pretrained, **model_args)
|
|
|
|
return _create_resnet('swsl_resnext101_32x8d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1273,8 +1264,8 @@ def swsl_resnext101_32x16d(pretrained=False, **kwargs):
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
`"Billion-scale Semi-Supervised Learning for Image Classification" <https://arxiv.org/abs/1905.00546>`_
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
Weights from https://github.com/facebookresearch/semi-supervised-ImageNet1K-models/
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=16, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=16)
|
|
|
|
return _create_resnet('swsl_resnext101_32x16d', pretrained, **model_args)
|
|
|
|
return _create_resnet('swsl_resnext101_32x16d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1285,8 +1276,8 @@ def ecaresnet26t(pretrained=False, **kwargs):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[2, 2, 2, 2], stem_width=32,
|
|
|
|
block=Bottleneck, layers=[2, 2, 2, 2], stem_width=32,
|
|
|
|
stem_type='deep_tiered', avg_down=True, block_args=dict(attn_layer='eca'), **kwargs)
|
|
|
|
stem_type='deep_tiered', avg_down=True, block_args=dict(attn_layer='eca'))
|
|
|
|
return _create_resnet('ecaresnet26t', pretrained, **model_args)
|
|
|
|
return _create_resnet('ecaresnet26t', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1295,8 +1286,8 @@ def ecaresnet50d(pretrained=False, **kwargs):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], stem_width=32, stem_type='deep', avg_down=True,
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], stem_width=32, stem_type='deep', avg_down=True,
|
|
|
|
block_args=dict(attn_layer='eca'), **kwargs)
|
|
|
|
block_args=dict(attn_layer='eca'))
|
|
|
|
return _create_resnet('ecaresnet50d', pretrained, **model_args)
|
|
|
|
return _create_resnet('ecaresnet50d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1306,7 +1297,7 @@ def ecaresnet50d_pruned(pretrained=False, **kwargs):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], stem_width=32, stem_type='deep', avg_down=True,
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], stem_width=32, stem_type='deep', avg_down=True,
|
|
|
|
block_args=dict(attn_layer='eca'), **kwargs)
|
|
|
|
block_args=dict(attn_layer='eca'))
|
|
|
|
return _create_resnet('ecaresnet50d_pruned', pretrained, pruned=True, **model_args)
|
|
|
|
return _create_resnet('ecaresnet50d_pruned', pretrained, pruned=True, **model_args)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1317,8 +1308,8 @@ def ecaresnet50t(pretrained=False, **kwargs):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], stem_width=32,
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], stem_width=32,
|
|
|
|
stem_type='deep_tiered', avg_down=True, block_args=dict(attn_layer='eca'), **kwargs)
|
|
|
|
stem_type='deep_tiered', avg_down=True, block_args=dict(attn_layer='eca'))
|
|
|
|
return _create_resnet('ecaresnet50t', pretrained, **model_args)
|
|
|
|
return _create_resnet('ecaresnet50t', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1327,8 +1318,8 @@ def ecaresnetlight(pretrained=False, **kwargs):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[1, 1, 11, 3], stem_width=32, avg_down=True,
|
|
|
|
block=Bottleneck, layers=[1, 1, 11, 3], stem_width=32, avg_down=True,
|
|
|
|
block_args=dict(attn_layer='eca'), **kwargs)
|
|
|
|
block_args=dict(attn_layer='eca'))
|
|
|
|
return _create_resnet('ecaresnetlight', pretrained, **model_args)
|
|
|
|
return _create_resnet('ecaresnetlight', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1337,8 +1328,8 @@ def ecaresnet101d(pretrained=False, **kwargs):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 4, 23, 3], stem_width=32, stem_type='deep', avg_down=True,
|
|
|
|
block=Bottleneck, layers=[3, 4, 23, 3], stem_width=32, stem_type='deep', avg_down=True,
|
|
|
|
block_args=dict(attn_layer='eca'), **kwargs)
|
|
|
|
block_args=dict(attn_layer='eca'))
|
|
|
|
return _create_resnet('ecaresnet101d', pretrained, **model_args)
|
|
|
|
return _create_resnet('ecaresnet101d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1348,7 +1339,7 @@ def ecaresnet101d_pruned(pretrained=False, **kwargs):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 4, 23, 3], stem_width=32, stem_type='deep', avg_down=True,
|
|
|
|
block=Bottleneck, layers=[3, 4, 23, 3], stem_width=32, stem_type='deep', avg_down=True,
|
|
|
|
block_args=dict(attn_layer='eca'), **kwargs)
|
|
|
|
block_args=dict(attn_layer='eca'))
|
|
|
|
return _create_resnet('ecaresnet101d_pruned', pretrained, pruned=True, **model_args)
|
|
|
|
return _create_resnet('ecaresnet101d_pruned', pretrained, pruned=True, **model_args)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1358,8 +1349,8 @@ def ecaresnet200d(pretrained=False, **kwargs):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 24, 36, 3], stem_width=32, stem_type='deep', avg_down=True,
|
|
|
|
block=Bottleneck, layers=[3, 24, 36, 3], stem_width=32, stem_type='deep', avg_down=True,
|
|
|
|
block_args=dict(attn_layer='eca'), **kwargs)
|
|
|
|
block_args=dict(attn_layer='eca'))
|
|
|
|
return _create_resnet('ecaresnet200d', pretrained, **model_args)
|
|
|
|
return _create_resnet('ecaresnet200d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1368,8 +1359,8 @@ def ecaresnet269d(pretrained=False, **kwargs):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 30, 48, 8], stem_width=32, stem_type='deep', avg_down=True,
|
|
|
|
block=Bottleneck, layers=[3, 30, 48, 8], stem_width=32, stem_type='deep', avg_down=True,
|
|
|
|
block_args=dict(attn_layer='eca'), **kwargs)
|
|
|
|
block_args=dict(attn_layer='eca'))
|
|
|
|
return _create_resnet('ecaresnet269d', pretrained, **model_args)
|
|
|
|
return _create_resnet('ecaresnet269d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1380,8 +1371,8 @@ def ecaresnext26t_32x4d(pretrained=False, **kwargs):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[2, 2, 2, 2], cardinality=32, base_width=4, stem_width=32,
|
|
|
|
block=Bottleneck, layers=[2, 2, 2, 2], cardinality=32, base_width=4, stem_width=32,
|
|
|
|
stem_type='deep_tiered', avg_down=True, block_args=dict(attn_layer='eca'), **kwargs)
|
|
|
|
stem_type='deep_tiered', avg_down=True, block_args=dict(attn_layer='eca'))
|
|
|
|
return _create_resnet('ecaresnext26t_32x4d', pretrained, **model_args)
|
|
|
|
return _create_resnet('ecaresnext26t_32x4d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1392,54 +1383,54 @@ def ecaresnext50t_32x4d(pretrained=False, **kwargs):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[2, 2, 2, 2], cardinality=32, base_width=4, stem_width=32,
|
|
|
|
block=Bottleneck, layers=[2, 2, 2, 2], cardinality=32, base_width=4, stem_width=32,
|
|
|
|
stem_type='deep_tiered', avg_down=True, block_args=dict(attn_layer='eca'), **kwargs)
|
|
|
|
stem_type='deep_tiered', avg_down=True, block_args=dict(attn_layer='eca'))
|
|
|
|
return _create_resnet('ecaresnext50t_32x4d', pretrained, **model_args)
|
|
|
|
return _create_resnet('ecaresnext50t_32x4d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def seresnet18(pretrained=False, **kwargs):
|
|
|
|
def seresnet18(pretrained=False, **kwargs):
|
|
|
|
model_args = dict(block=BasicBlock, layers=[2, 2, 2, 2], block_args=dict(attn_layer='se'), **kwargs)
|
|
|
|
model_args = dict(block=BasicBlock, layers=[2, 2, 2, 2], block_args=dict(attn_layer='se'))
|
|
|
|
return _create_resnet('seresnet18', pretrained, **model_args)
|
|
|
|
return _create_resnet('seresnet18', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def seresnet34(pretrained=False, **kwargs):
|
|
|
|
def seresnet34(pretrained=False, **kwargs):
|
|
|
|
model_args = dict(block=BasicBlock, layers=[3, 4, 6, 3], block_args=dict(attn_layer='se'), **kwargs)
|
|
|
|
model_args = dict(block=BasicBlock, layers=[3, 4, 6, 3], block_args=dict(attn_layer='se'))
|
|
|
|
return _create_resnet('seresnet34', pretrained, **model_args)
|
|
|
|
return _create_resnet('seresnet34', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def seresnet50(pretrained=False, **kwargs):
|
|
|
|
def seresnet50(pretrained=False, **kwargs):
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], block_args=dict(attn_layer='se'), **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], block_args=dict(attn_layer='se'))
|
|
|
|
return _create_resnet('seresnet50', pretrained, **model_args)
|
|
|
|
return _create_resnet('seresnet50', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def seresnet50t(pretrained=False, **kwargs):
|
|
|
|
def seresnet50t(pretrained=False, **kwargs):
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], stem_width=32, stem_type='deep_tiered', avg_down=True,
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], stem_width=32, stem_type='deep_tiered',
|
|
|
|
block_args=dict(attn_layer='se'), **kwargs)
|
|
|
|
avg_down=True, block_args=dict(attn_layer='se'))
|
|
|
|
return _create_resnet('seresnet50t', pretrained, **model_args)
|
|
|
|
return _create_resnet('seresnet50t', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def seresnet101(pretrained=False, **kwargs):
|
|
|
|
def seresnet101(pretrained=False, **kwargs):
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], block_args=dict(attn_layer='se'), **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 23, 3], block_args=dict(attn_layer='se'))
|
|
|
|
return _create_resnet('seresnet101', pretrained, **model_args)
|
|
|
|
return _create_resnet('seresnet101', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def seresnet152(pretrained=False, **kwargs):
|
|
|
|
def seresnet152(pretrained=False, **kwargs):
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 8, 36, 3], block_args=dict(attn_layer='se'), **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 8, 36, 3], block_args=dict(attn_layer='se'))
|
|
|
|
return _create_resnet('seresnet152', pretrained, **model_args)
|
|
|
|
return _create_resnet('seresnet152', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def seresnet152d(pretrained=False, **kwargs):
|
|
|
|
def seresnet152d(pretrained=False, **kwargs):
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 8, 36, 3], stem_width=32, stem_type='deep', avg_down=True,
|
|
|
|
block=Bottleneck, layers=[3, 8, 36, 3], stem_width=32, stem_type='deep',
|
|
|
|
block_args=dict(attn_layer='se'), **kwargs)
|
|
|
|
avg_down=True, block_args=dict(attn_layer='se'))
|
|
|
|
return _create_resnet('seresnet152d', pretrained, **model_args)
|
|
|
|
return _create_resnet('seresnet152d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1447,9 +1438,9 @@ def seresnet200d(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-200-D model with SE attn.
|
|
|
|
"""Constructs a ResNet-200-D model with SE attn.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 24, 36, 3], stem_width=32, stem_type='deep', avg_down=True,
|
|
|
|
block=Bottleneck, layers=[3, 24, 36, 3], stem_width=32, stem_type='deep',
|
|
|
|
block_args=dict(attn_layer='se'), **kwargs)
|
|
|
|
avg_down=True, block_args=dict(attn_layer='se'))
|
|
|
|
return _create_resnet('seresnet200d', pretrained, **model_args)
|
|
|
|
return _create_resnet('seresnet200d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1457,9 +1448,9 @@ def seresnet269d(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-269-D model with SE attn.
|
|
|
|
"""Constructs a ResNet-269-D model with SE attn.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 30, 48, 8], stem_width=32, stem_type='deep', avg_down=True,
|
|
|
|
block=Bottleneck, layers=[3, 30, 48, 8], stem_width=32, stem_type='deep',
|
|
|
|
block_args=dict(attn_layer='se'), **kwargs)
|
|
|
|
avg_down=True, block_args=dict(attn_layer='se'))
|
|
|
|
return _create_resnet('seresnet269d', pretrained, **model_args)
|
|
|
|
return _create_resnet('seresnet269d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1470,8 +1461,8 @@ def seresnext26d_32x4d(pretrained=False, **kwargs):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[2, 2, 2, 2], cardinality=32, base_width=4, stem_width=32,
|
|
|
|
block=Bottleneck, layers=[2, 2, 2, 2], cardinality=32, base_width=4, stem_width=32,
|
|
|
|
stem_type='deep', avg_down=True, block_args=dict(attn_layer='se'), **kwargs)
|
|
|
|
stem_type='deep', avg_down=True, block_args=dict(attn_layer='se'))
|
|
|
|
return _create_resnet('seresnext26d_32x4d', pretrained, **model_args)
|
|
|
|
return _create_resnet('seresnext26d_32x4d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1482,8 +1473,8 @@ def seresnext26t_32x4d(pretrained=False, **kwargs):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[2, 2, 2, 2], cardinality=32, base_width=4, stem_width=32,
|
|
|
|
block=Bottleneck, layers=[2, 2, 2, 2], cardinality=32, base_width=4, stem_width=32,
|
|
|
|
stem_type='deep_tiered', avg_down=True, block_args=dict(attn_layer='se'), **kwargs)
|
|
|
|
stem_type='deep_tiered', avg_down=True, block_args=dict(attn_layer='se'))
|
|
|
|
return _create_resnet('seresnext26t_32x4d', pretrained, **model_args)
|
|
|
|
return _create_resnet('seresnext26t_32x4d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1499,24 +1490,24 @@ def seresnext26tn_32x4d(pretrained=False, **kwargs):
|
|
|
|
def seresnext50_32x4d(pretrained=False, **kwargs):
|
|
|
|
def seresnext50_32x4d(pretrained=False, **kwargs):
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], cardinality=32, base_width=4,
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], cardinality=32, base_width=4,
|
|
|
|
block_args=dict(attn_layer='se'), **kwargs)
|
|
|
|
block_args=dict(attn_layer='se'))
|
|
|
|
return _create_resnet('seresnext50_32x4d', pretrained, **model_args)
|
|
|
|
return _create_resnet('seresnext50_32x4d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def seresnext101_32x4d(pretrained=False, **kwargs):
|
|
|
|
def seresnext101_32x4d(pretrained=False, **kwargs):
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=4,
|
|
|
|
block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=4,
|
|
|
|
block_args=dict(attn_layer='se'), **kwargs)
|
|
|
|
block_args=dict(attn_layer='se'))
|
|
|
|
return _create_resnet('seresnext101_32x4d', pretrained, **model_args)
|
|
|
|
return _create_resnet('seresnext101_32x4d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def seresnext101_32x8d(pretrained=False, **kwargs):
|
|
|
|
def seresnext101_32x8d(pretrained=False, **kwargs):
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=8,
|
|
|
|
block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=8,
|
|
|
|
block_args=dict(attn_layer='se'), **kwargs)
|
|
|
|
block_args=dict(attn_layer='se'))
|
|
|
|
return _create_resnet('seresnext101_32x8d', pretrained, **model_args)
|
|
|
|
return _create_resnet('seresnext101_32x8d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1524,32 +1515,32 @@ def seresnext101d_32x8d(pretrained=False, **kwargs):
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=8,
|
|
|
|
block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=8,
|
|
|
|
stem_width=32, stem_type='deep', avg_down=True,
|
|
|
|
stem_width=32, stem_type='deep', avg_down=True,
|
|
|
|
block_args=dict(attn_layer='se'), **kwargs)
|
|
|
|
block_args=dict(attn_layer='se'))
|
|
|
|
return _create_resnet('seresnext101d_32x8d', pretrained, **model_args)
|
|
|
|
return _create_resnet('seresnext101d_32x8d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def senet154(pretrained=False, **kwargs):
|
|
|
|
def senet154(pretrained=False, **kwargs):
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 8, 36, 3], cardinality=64, base_width=4, stem_type='deep',
|
|
|
|
block=Bottleneck, layers=[3, 8, 36, 3], cardinality=64, base_width=4, stem_type='deep',
|
|
|
|
down_kernel_size=3, block_reduce_first=2, block_args=dict(attn_layer='se'), **kwargs)
|
|
|
|
down_kernel_size=3, block_reduce_first=2, block_args=dict(attn_layer='se'))
|
|
|
|
return _create_resnet('senet154', pretrained, **model_args)
|
|
|
|
return _create_resnet('senet154', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnetblur18(pretrained=False, **kwargs):
|
|
|
|
def resnetblur18(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-18 model with blur anti-aliasing
|
|
|
|
"""Constructs a ResNet-18 model with blur anti-aliasing
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=BasicBlock, layers=[2, 2, 2, 2], aa_layer=BlurPool2d, **kwargs)
|
|
|
|
model_args = dict(block=BasicBlock, layers=[2, 2, 2, 2], aa_layer=BlurPool2d)
|
|
|
|
return _create_resnet('resnetblur18', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnetblur18', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnetblur50(pretrained=False, **kwargs):
|
|
|
|
def resnetblur50(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-50 model with blur anti-aliasing
|
|
|
|
"""Constructs a ResNet-50 model with blur anti-aliasing
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], aa_layer=BlurPool2d, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], aa_layer=BlurPool2d)
|
|
|
|
return _create_resnet('resnetblur50', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnetblur50', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1558,8 +1549,8 @@ def resnetblur50d(pretrained=False, **kwargs):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], aa_layer=BlurPool2d,
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], aa_layer=BlurPool2d,
|
|
|
|
stem_width=32, stem_type='deep', avg_down=True, **kwargs)
|
|
|
|
stem_width=32, stem_type='deep', avg_down=True)
|
|
|
|
return _create_resnet('resnetblur50d', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnetblur50d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1568,16 +1559,25 @@ def resnetblur101d(pretrained=False, **kwargs):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 4, 23, 3], aa_layer=BlurPool2d,
|
|
|
|
block=Bottleneck, layers=[3, 4, 23, 3], aa_layer=BlurPool2d,
|
|
|
|
stem_width=32, stem_type='deep', avg_down=True, **kwargs)
|
|
|
|
stem_width=32, stem_type='deep', avg_down=True)
|
|
|
|
return _create_resnet('resnetblur101d', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnetblur101d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
|
|
|
|
def resnetaa34d(pretrained=False, **kwargs):
|
|
|
|
|
|
|
|
"""Constructs a ResNet-34-D model w/ avgpool anti-aliasing
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
model_args = dict(
|
|
|
|
|
|
|
|
block=BasicBlock, layers=[3, 4, 6, 3], aa_layer=nn.AvgPool2d, stem_width=32, stem_type='deep', avg_down=True)
|
|
|
|
|
|
|
|
return _create_resnet('resnetaa34d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
|
def resnetaa50(pretrained=False, **kwargs):
|
|
|
|
def resnetaa50(pretrained=False, **kwargs):
|
|
|
|
"""Constructs a ResNet-50 model with avgpool anti-aliasing
|
|
|
|
"""Constructs a ResNet-50 model with avgpool anti-aliasing
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], aa_layer=nn.AvgPool2d, **kwargs)
|
|
|
|
model_args = dict(block=Bottleneck, layers=[3, 4, 6, 3], aa_layer=nn.AvgPool2d)
|
|
|
|
return _create_resnet('resnetaa50', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnetaa50', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1586,8 +1586,8 @@ def resnetaa50d(pretrained=False, **kwargs):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], aa_layer=nn.AvgPool2d,
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], aa_layer=nn.AvgPool2d,
|
|
|
|
stem_width=32, stem_type='deep', avg_down=True, **kwargs)
|
|
|
|
stem_width=32, stem_type='deep', avg_down=True)
|
|
|
|
return _create_resnet('resnetaa50d', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnetaa50d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1596,8 +1596,8 @@ def resnetaa101d(pretrained=False, **kwargs):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 4, 23, 3], aa_layer=nn.AvgPool2d,
|
|
|
|
block=Bottleneck, layers=[3, 4, 23, 3], aa_layer=nn.AvgPool2d,
|
|
|
|
stem_width=32, stem_type='deep', avg_down=True, **kwargs)
|
|
|
|
stem_width=32, stem_type='deep', avg_down=True)
|
|
|
|
return _create_resnet('resnetaa101d', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnetaa101d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1606,8 +1606,8 @@ def seresnetaa50d(pretrained=False, **kwargs):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], aa_layer=nn.AvgPool2d,
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], aa_layer=nn.AvgPool2d,
|
|
|
|
stem_width=32, stem_type='deep', avg_down=True, block_args=dict(attn_layer='se'), **kwargs)
|
|
|
|
stem_width=32, stem_type='deep', avg_down=True, block_args=dict(attn_layer='se'))
|
|
|
|
return _create_resnet('seresnetaa50d', pretrained, **model_args)
|
|
|
|
return _create_resnet('seresnetaa50d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1617,8 +1617,8 @@ def seresnextaa101d_32x8d(pretrained=False, **kwargs):
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=8,
|
|
|
|
block=Bottleneck, layers=[3, 4, 23, 3], cardinality=32, base_width=8,
|
|
|
|
stem_width=32, stem_type='deep', avg_down=True, aa_layer=nn.AvgPool2d,
|
|
|
|
stem_width=32, stem_type='deep', avg_down=True, aa_layer=nn.AvgPool2d,
|
|
|
|
block_args=dict(attn_layer='se'), **kwargs)
|
|
|
|
block_args=dict(attn_layer='se'))
|
|
|
|
return _create_resnet('seresnextaa101d_32x8d', pretrained, **model_args)
|
|
|
|
return _create_resnet('seresnextaa101d_32x8d', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1630,8 +1630,8 @@ def resnetrs50(pretrained=False, **kwargs):
|
|
|
|
attn_layer = partial(get_attn('se'), rd_ratio=0.25)
|
|
|
|
attn_layer = partial(get_attn('se'), rd_ratio=0.25)
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], stem_width=32, stem_type='deep', replace_stem_pool=True,
|
|
|
|
block=Bottleneck, layers=[3, 4, 6, 3], stem_width=32, stem_type='deep', replace_stem_pool=True,
|
|
|
|
avg_down=True, block_args=dict(attn_layer=attn_layer), **kwargs)
|
|
|
|
avg_down=True, block_args=dict(attn_layer=attn_layer))
|
|
|
|
return _create_resnet('resnetrs50', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnetrs50', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1643,8 +1643,8 @@ def resnetrs101(pretrained=False, **kwargs):
|
|
|
|
attn_layer = partial(get_attn('se'), rd_ratio=0.25)
|
|
|
|
attn_layer = partial(get_attn('se'), rd_ratio=0.25)
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 4, 23, 3], stem_width=32, stem_type='deep', replace_stem_pool=True,
|
|
|
|
block=Bottleneck, layers=[3, 4, 23, 3], stem_width=32, stem_type='deep', replace_stem_pool=True,
|
|
|
|
avg_down=True, block_args=dict(attn_layer=attn_layer), **kwargs)
|
|
|
|
avg_down=True, block_args=dict(attn_layer=attn_layer))
|
|
|
|
return _create_resnet('resnetrs101', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnetrs101', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1656,8 +1656,8 @@ def resnetrs152(pretrained=False, **kwargs):
|
|
|
|
attn_layer = partial(get_attn('se'), rd_ratio=0.25)
|
|
|
|
attn_layer = partial(get_attn('se'), rd_ratio=0.25)
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 8, 36, 3], stem_width=32, stem_type='deep', replace_stem_pool=True,
|
|
|
|
block=Bottleneck, layers=[3, 8, 36, 3], stem_width=32, stem_type='deep', replace_stem_pool=True,
|
|
|
|
avg_down=True, block_args=dict(attn_layer=attn_layer), **kwargs)
|
|
|
|
avg_down=True, block_args=dict(attn_layer=attn_layer))
|
|
|
|
return _create_resnet('resnetrs152', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnetrs152', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1669,8 +1669,8 @@ def resnetrs200(pretrained=False, **kwargs):
|
|
|
|
attn_layer = partial(get_attn('se'), rd_ratio=0.25)
|
|
|
|
attn_layer = partial(get_attn('se'), rd_ratio=0.25)
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[3, 24, 36, 3], stem_width=32, stem_type='deep', replace_stem_pool=True,
|
|
|
|
block=Bottleneck, layers=[3, 24, 36, 3], stem_width=32, stem_type='deep', replace_stem_pool=True,
|
|
|
|
avg_down=True, block_args=dict(attn_layer=attn_layer), **kwargs)
|
|
|
|
avg_down=True, block_args=dict(attn_layer=attn_layer))
|
|
|
|
return _create_resnet('resnetrs200', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnetrs200', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1682,8 +1682,8 @@ def resnetrs270(pretrained=False, **kwargs):
|
|
|
|
attn_layer = partial(get_attn('se'), rd_ratio=0.25)
|
|
|
|
attn_layer = partial(get_attn('se'), rd_ratio=0.25)
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[4, 29, 53, 4], stem_width=32, stem_type='deep', replace_stem_pool=True,
|
|
|
|
block=Bottleneck, layers=[4, 29, 53, 4], stem_width=32, stem_type='deep', replace_stem_pool=True,
|
|
|
|
avg_down=True, block_args=dict(attn_layer=attn_layer), **kwargs)
|
|
|
|
avg_down=True, block_args=dict(attn_layer=attn_layer))
|
|
|
|
return _create_resnet('resnetrs270', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnetrs270', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1696,8 +1696,8 @@ def resnetrs350(pretrained=False, **kwargs):
|
|
|
|
attn_layer = partial(get_attn('se'), rd_ratio=0.25)
|
|
|
|
attn_layer = partial(get_attn('se'), rd_ratio=0.25)
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[4, 36, 72, 4], stem_width=32, stem_type='deep', replace_stem_pool=True,
|
|
|
|
block=Bottleneck, layers=[4, 36, 72, 4], stem_width=32, stem_type='deep', replace_stem_pool=True,
|
|
|
|
avg_down=True, block_args=dict(attn_layer=attn_layer), **kwargs)
|
|
|
|
avg_down=True, block_args=dict(attn_layer=attn_layer))
|
|
|
|
return _create_resnet('resnetrs350', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnetrs350', pretrained, **dict(model_args, **kwargs))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
@register_model
|
|
|
@ -1709,5 +1709,5 @@ def resnetrs420(pretrained=False, **kwargs):
|
|
|
|
attn_layer = partial(get_attn('se'), rd_ratio=0.25)
|
|
|
|
attn_layer = partial(get_attn('se'), rd_ratio=0.25)
|
|
|
|
model_args = dict(
|
|
|
|
model_args = dict(
|
|
|
|
block=Bottleneck, layers=[4, 44, 87, 4], stem_width=32, stem_type='deep', replace_stem_pool=True,
|
|
|
|
block=Bottleneck, layers=[4, 44, 87, 4], stem_width=32, stem_type='deep', replace_stem_pool=True,
|
|
|
|
avg_down=True, block_args=dict(attn_layer=attn_layer), **kwargs)
|
|
|
|
avg_down=True, block_args=dict(attn_layer=attn_layer))
|
|
|
|
return _create_resnet('resnetrs420', pretrained, **model_args)
|
|
|
|
return _create_resnet('resnetrs420', pretrained, **dict(model_args, **kwargs))
|
|
|
|