|
|
|
@ -45,15 +45,16 @@ def _cfg(url='', **kwargs):
|
|
|
|
|
|
|
|
|
|
default_cfgs = {
|
|
|
|
|
# GPU-Efficient (ResNet) weights
|
|
|
|
|
'botnet26t_256': _cfg(url='', fixed_input_size=True, input_size=(3, 256, 256)),
|
|
|
|
|
'botnet50t_224': _cfg(url='', fixed_input_size=True),
|
|
|
|
|
'botnet50t_c4c5_224': _cfg(url='', fixed_input_size=True),
|
|
|
|
|
|
|
|
|
|
'halonet_h1': _cfg(url='', input_size=(3, 256, 256), pool_size=(8, 8), min_input_size=(3, 256, 256)),
|
|
|
|
|
'halonet_h1_c4c5': _cfg(url='', input_size=(3, 256, 256), pool_size=(8, 8), min_input_size=(3, 256, 256)),
|
|
|
|
|
'halonet26t': _cfg(url=''),
|
|
|
|
|
'halonet26t': _cfg(url='', input_size=(3, 256, 256)),
|
|
|
|
|
'halonet50t': _cfg(url=''),
|
|
|
|
|
|
|
|
|
|
'lambda_resnet26t': _cfg(url='', min_input_size=(3, 128, 128)),
|
|
|
|
|
'lambda_resnet26t': _cfg(url='', min_input_size=(3, 128, 128), input_size=(3, 256, 256)),
|
|
|
|
|
'lambda_resnet50t': _cfg(url='', min_input_size=(3, 128, 128)),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -92,6 +93,21 @@ def interleave_attn(
|
|
|
|
|
|
|
|
|
|
model_cfgs = dict(
|
|
|
|
|
|
|
|
|
|
botnet26t=ByoaCfg(
|
|
|
|
|
blocks=(
|
|
|
|
|
ByoaBlocksCfg(type='bottle', d=3, c=256, s=2, gs=0, br=0.25),
|
|
|
|
|
ByoaBlocksCfg(type='bottle', d=4, c=512, s=2, gs=0, br=0.25),
|
|
|
|
|
interleave_attn(types=('bottle', 'self_attn'), every=1, d=2, c=1024, s=2, gs=0, br=0.25),
|
|
|
|
|
ByoaBlocksCfg(type='self_attn', d=3, c=2048, s=1, gs=0, br=0.25),
|
|
|
|
|
),
|
|
|
|
|
stem_chs=64,
|
|
|
|
|
stem_type='tiered',
|
|
|
|
|
stem_pool='maxpool',
|
|
|
|
|
num_features=0,
|
|
|
|
|
self_attn_layer='bottleneck',
|
|
|
|
|
self_attn_fixed_size=True,
|
|
|
|
|
self_attn_kwargs=dict()
|
|
|
|
|
),
|
|
|
|
|
botnet50t=ByoaCfg(
|
|
|
|
|
blocks=(
|
|
|
|
|
ByoaBlocksCfg(type='bottle', d=3, c=256, s=2, gs=0, br=0.25),
|
|
|
|
@ -161,7 +177,7 @@ model_cfgs = dict(
|
|
|
|
|
blocks=(
|
|
|
|
|
ByoaBlocksCfg(type='bottle', d=2, c=256, s=1, gs=0, br=0.25),
|
|
|
|
|
ByoaBlocksCfg(type='bottle', d=2, c=512, s=2, gs=0, br=0.25),
|
|
|
|
|
ByoaBlocksCfg(type='bottle', d=2, c=1024, s=2, gs=0, br=0.25),
|
|
|
|
|
interleave_attn(types=('bottle', 'self_attn'), every=1, d=2, c=1024, s=2, gs=0, br=0.25),
|
|
|
|
|
ByoaBlocksCfg(type='self_attn', d=2, c=2048, s=2, gs=0, br=0.25),
|
|
|
|
|
),
|
|
|
|
|
stem_chs=64,
|
|
|
|
@ -169,7 +185,7 @@ model_cfgs = dict(
|
|
|
|
|
stem_pool='maxpool',
|
|
|
|
|
num_features=0,
|
|
|
|
|
self_attn_layer='halo',
|
|
|
|
|
self_attn_kwargs=dict(block_size=7, halo_size=2)
|
|
|
|
|
self_attn_kwargs=dict(block_size=8, halo_size=2) # intended for 256x256 res
|
|
|
|
|
),
|
|
|
|
|
halonet50t=ByoaCfg(
|
|
|
|
|
blocks=(
|
|
|
|
@ -370,6 +386,14 @@ def _create_byoanet(variant, cfg_variant=None, pretrained=False, **kwargs):
|
|
|
|
|
**kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
|
def botnet26t_256(pretrained=False, **kwargs):
|
|
|
|
|
""" Bottleneck Transformer w/ ResNet26-T backbone. Bottleneck attn in final stage.
|
|
|
|
|
"""
|
|
|
|
|
kwargs.setdefault('img_size', 256)
|
|
|
|
|
return _create_byoanet('botnet26t_256', 'botnet26t', pretrained=pretrained, **kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register_model
|
|
|
|
|
def botnet50t_224(pretrained=False, **kwargs):
|
|
|
|
|
""" Bottleneck Transformer w/ ResNet50-T backbone. Bottleneck attn in final stage.
|
|
|
|
|