Skip to content

builder

model.backbone.builder

logger module-attribute

logger = getLogger('SaigeResearch')

native_models module-attribute

native_models = {'van_b0': van_b0, 'van_b1': van_b1, 'van_b2': van_b2, 'van_b3': van_b3, 'regnet_y_400mf_torchvision': regnet_y_400mf, 'regnet_y_800mf_torchvision': regnet_y_800mf, 'regnet_y_1_6gf_torchvision': regnet_y_1_6gf, 'regnet_y_3_2gf_torchvision': regnet_y_3_2gf, 'regnet_y_8gf_torchvision': regnet_y_8gf, 'regnet_y_16gf_torchvision': regnet_y_16gf, 'regnet_y_32gf_torchvision': regnet_y_32gf, 'regnet_y_128gf_torchvision': regnet_y_128gf, 'regnet_x_400mf_torchvision': regnet_x_400mf, 'regnet_x_800mf_torchvision': regnet_x_800mf, 'regnet_x_1_6gf_torchvision': regnet_x_1_6gf, 'regnet_x_3_2gf_torchvision': regnet_x_3_2gf, 'regnet_x_8gf_torchvision': regnet_x_8gf, 'regnet_x_16gf_torchvision': regnet_x_16gf, 'regnet_x_32gf_torchvision': regnet_x_32gf, 'resnet18_torchvision': resnet18, 'resnet34_torchvision': resnet34, 'resnet50_torchvision': resnet50, 'resnet101_torchvision': resnet101, 'resnet152_torchvision': resnet152, 'resnext50_32x4d_torchvision': resnext50_32x4d, 'resnext101_32x8d_torchvision': resnext101_32x8d, 'resnext101_64x4d_torchvision': resnext101_64x4d, 'wide_resnet50_2_torchvision': wide_resnet50_2, 'wide_resnet101_2_torchvision': wide_resnet101_2, 'squeezenet1_0_torchvision': squeezenet1_0, 'squeezenet1_1_torchvision': squeezenet1_1, 'vgg11_torchvision': vgg11, 'vgg11_bn_torchvision': vgg11_bn, 'vgg13_torchvision': vgg13, 'vgg13_bn_torchvision': vgg13_bn, 'vgg16_torchvision': vgg16, 'vgg16_bn_torchvision': vgg16_bn, 'vgg19_torchvision': vgg19, 'vgg19_bn_torchvision': vgg19_bn}

van_b0

van_b0(pretrained=False, **kwargs)
Source code in SaigeToolkit/model/backbone/van.py
def van_b0(pretrained=False, **kwargs):
    model = VAN(
        embed_dims=[32, 64, 160, 256],
        mlp_ratios=[8, 8, 4, 4],
        norm_layer=partial(nn.LayerNorm, eps=1e-6),
        depths=[3, 3, 5, 2],
        **kwargs,
    )
    model.default_cfg = _cfg()
    if pretrained:
        model = load_model_weights(model, "van_b0", kwargs)
    return model

van_b1

van_b1(pretrained=False, **kwargs)
Source code in SaigeToolkit/model/backbone/van.py
def van_b1(pretrained=False, **kwargs):
    model = VAN(
        embed_dims=[64, 128, 320, 512],
        mlp_ratios=[8, 8, 4, 4],
        norm_layer=partial(nn.LayerNorm, eps=1e-6),
        depths=[2, 2, 4, 2],
        **kwargs,
    )
    model.default_cfg = _cfg()
    if pretrained:
        model = load_model_weights(model, "van_b1", kwargs)
    return model

van_b2

van_b2(pretrained=False, **kwargs)
Source code in SaigeToolkit/model/backbone/van.py
def van_b2(pretrained=False, **kwargs):
    model = VAN(
        embed_dims=[64, 128, 320, 512],
        mlp_ratios=[8, 8, 4, 4],
        norm_layer=partial(nn.LayerNorm, eps=1e-6),
        depths=[3, 3, 12, 3],
        **kwargs,
    )
    model.default_cfg = _cfg()
    if pretrained:
        model = load_model_weights(model, "van_b2", kwargs)
    return model

van_b3

van_b3(pretrained=False, **kwargs)
Source code in SaigeToolkit/model/backbone/van.py
def van_b3(pretrained=False, **kwargs):
    model = VAN(
        embed_dims=[64, 128, 320, 512],
        mlp_ratios=[8, 8, 4, 4],
        norm_layer=partial(nn.LayerNorm, eps=1e-6),
        depths=[3, 5, 27, 3],
        **kwargs,
    )
    model.default_cfg = _cfg()
    if pretrained:
        model = load_model_weights(model, "van_b3", kwargs)
    return model

regnet_y_400mf

regnet_y_400mf(*, weights: Optional[RegNet_Y_400MF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetY_400MF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_Y_400MF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_Y_400MF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_Y_400MF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_Y_400MF_Weights.IMAGENET1K_V1))
def regnet_y_400mf(
    *, weights: Optional[RegNet_Y_400MF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetY_400MF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_Y_400MF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_400MF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_Y_400MF_Weights
        :members:
    """
    weights = RegNet_Y_400MF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=16, w_0=48, w_a=27.89, w_m=2.09, group_width=8, se_ratio=0.25, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_y_800mf

regnet_y_800mf(*, weights: Optional[RegNet_Y_800MF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetY_800MF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_Y_800MF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_Y_800MF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_Y_800MF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_Y_800MF_Weights.IMAGENET1K_V1))
def regnet_y_800mf(
    *, weights: Optional[RegNet_Y_800MF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetY_800MF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_Y_800MF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_800MF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_Y_800MF_Weights
        :members:
    """
    weights = RegNet_Y_800MF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=14, w_0=56, w_a=38.84, w_m=2.4, group_width=16, se_ratio=0.25, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_y_1_6gf

regnet_y_1_6gf(*, weights: Optional[RegNet_Y_1_6GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetY_1.6GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_Y_1_6GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_Y_1_6GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_Y_1_6GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_Y_1_6GF_Weights.IMAGENET1K_V1))
def regnet_y_1_6gf(
    *, weights: Optional[RegNet_Y_1_6GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetY_1.6GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_Y_1_6GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_1_6GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_Y_1_6GF_Weights
        :members:
    """
    weights = RegNet_Y_1_6GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=27, w_0=48, w_a=20.71, w_m=2.65, group_width=24, se_ratio=0.25, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_y_3_2gf

regnet_y_3_2gf(*, weights: Optional[RegNet_Y_3_2GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetY_3.2GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_Y_3_2GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_Y_3_2GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_Y_3_2GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_Y_3_2GF_Weights.IMAGENET1K_V1))
def regnet_y_3_2gf(
    *, weights: Optional[RegNet_Y_3_2GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetY_3.2GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_Y_3_2GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_3_2GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_Y_3_2GF_Weights
        :members:
    """
    weights = RegNet_Y_3_2GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=21, w_0=80, w_a=42.63, w_m=2.66, group_width=24, se_ratio=0.25, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_y_8gf

regnet_y_8gf(*, weights: Optional[RegNet_Y_8GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetY_8GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_Y_8GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_Y_8GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_Y_8GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_Y_8GF_Weights.IMAGENET1K_V1))
def regnet_y_8gf(
    *, weights: Optional[RegNet_Y_8GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetY_8GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_Y_8GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_8GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_Y_8GF_Weights
        :members:
    """
    weights = RegNet_Y_8GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=17, w_0=192, w_a=76.82, w_m=2.19, group_width=56, se_ratio=0.25, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_y_16gf

regnet_y_16gf(*, weights: Optional[RegNet_Y_16GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetY_16GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_Y_16GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_Y_16GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_Y_16GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_Y_16GF_Weights.IMAGENET1K_V1))
def regnet_y_16gf(
    *, weights: Optional[RegNet_Y_16GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetY_16GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_Y_16GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_16GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_Y_16GF_Weights
        :members:
    """
    weights = RegNet_Y_16GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=18, w_0=200, w_a=106.23, w_m=2.48, group_width=112, se_ratio=0.25, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_y_32gf

regnet_y_32gf(*, weights: Optional[RegNet_Y_32GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetY_32GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_Y_32GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_Y_32GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_Y_32GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_Y_32GF_Weights.IMAGENET1K_V1))
def regnet_y_32gf(
    *, weights: Optional[RegNet_Y_32GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetY_32GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_Y_32GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_32GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_Y_32GF_Weights
        :members:
    """
    weights = RegNet_Y_32GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=20, w_0=232, w_a=115.89, w_m=2.53, group_width=232, se_ratio=0.25, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_y_128gf

regnet_y_128gf(*, weights: Optional[RegNet_Y_128GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetY_128GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_Y_128GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_Y_128GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_Y_128GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", None))
def regnet_y_128gf(
    *, weights: Optional[RegNet_Y_128GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetY_128GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_Y_128GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_128GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_Y_128GF_Weights
        :members:
    """
    weights = RegNet_Y_128GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=27, w_0=456, w_a=160.83, w_m=2.52, group_width=264, se_ratio=0.25, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_x_400mf

regnet_x_400mf(*, weights: Optional[RegNet_X_400MF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetX_400MF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_X_400MF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_X_400MF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_X_400MF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_X_400MF_Weights.IMAGENET1K_V1))
def regnet_x_400mf(
    *, weights: Optional[RegNet_X_400MF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetX_400MF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_X_400MF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_400MF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_X_400MF_Weights
        :members:
    """
    weights = RegNet_X_400MF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=22, w_0=24, w_a=24.48, w_m=2.54, group_width=16, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_x_800mf

regnet_x_800mf(*, weights: Optional[RegNet_X_800MF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetX_800MF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_X_800MF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_X_800MF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_X_800MF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_X_800MF_Weights.IMAGENET1K_V1))
def regnet_x_800mf(
    *, weights: Optional[RegNet_X_800MF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetX_800MF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_X_800MF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_800MF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_X_800MF_Weights
        :members:
    """
    weights = RegNet_X_800MF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=16, w_0=56, w_a=35.73, w_m=2.28, group_width=16, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_x_1_6gf

regnet_x_1_6gf(*, weights: Optional[RegNet_X_1_6GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetX_1.6GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_X_1_6GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_X_1_6GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_X_1_6GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_X_1_6GF_Weights.IMAGENET1K_V1))
def regnet_x_1_6gf(
    *, weights: Optional[RegNet_X_1_6GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetX_1.6GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_X_1_6GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_1_6GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_X_1_6GF_Weights
        :members:
    """
    weights = RegNet_X_1_6GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=18, w_0=80, w_a=34.01, w_m=2.25, group_width=24, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_x_3_2gf

regnet_x_3_2gf(*, weights: Optional[RegNet_X_3_2GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetX_3.2GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_X_3_2GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_X_3_2GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_X_3_2GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_X_3_2GF_Weights.IMAGENET1K_V1))
def regnet_x_3_2gf(
    *, weights: Optional[RegNet_X_3_2GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetX_3.2GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_X_3_2GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_3_2GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_X_3_2GF_Weights
        :members:
    """
    weights = RegNet_X_3_2GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=25, w_0=88, w_a=26.31, w_m=2.25, group_width=48, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_x_8gf

regnet_x_8gf(*, weights: Optional[RegNet_X_8GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetX_8GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_X_8GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_X_8GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_X_8GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_X_8GF_Weights.IMAGENET1K_V1))
def regnet_x_8gf(
    *, weights: Optional[RegNet_X_8GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetX_8GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_X_8GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_8GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_X_8GF_Weights
        :members:
    """
    weights = RegNet_X_8GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=23, w_0=80, w_a=49.56, w_m=2.88, group_width=120, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_x_16gf

regnet_x_16gf(*, weights: Optional[RegNet_X_16GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetX_16GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_X_16GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_X_16GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_X_16GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_X_16GF_Weights.IMAGENET1K_V1))
def regnet_x_16gf(
    *, weights: Optional[RegNet_X_16GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetX_16GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_X_16GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_16GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_X_16GF_Weights
        :members:
    """
    weights = RegNet_X_16GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=22, w_0=216, w_a=55.59, w_m=2.1, group_width=128, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_x_32gf

regnet_x_32gf(*, weights: Optional[RegNet_X_32GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetX_32GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_X_32GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_X_32GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_X_32GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_X_32GF_Weights.IMAGENET1K_V1))
def regnet_x_32gf(
    *, weights: Optional[RegNet_X_32GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetX_32GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_X_32GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_32GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_X_32GF_Weights
        :members:
    """
    weights = RegNet_X_32GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=23, w_0=320, w_a=69.86, w_m=2.0, group_width=168, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

resnet18

resnet18(*, weights: Optional[ResNet18_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet

ResNet-18 from Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>__.

Parameters:

  • weights

    class:~torchvision.models.ResNet18_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.ResNet18_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.resnet.ResNet base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.

.. autoclass:: torchvision.models.ResNet18_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
@handle_legacy_interface(weights=("pretrained", ResNet18_Weights.IMAGENET1K_V1))
def resnet18(
    *, weights: Optional[ResNet18_Weights] = None, progress: bool = True, **kwargs: Any
) -> ResNet:
    """ResNet-18 from `Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>`__.

    Args:
        weights (:class:`~torchvision.models.ResNet18_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.ResNet18_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.ResNet18_Weights
        :members:
    """
    weights = ResNet18_Weights.verify(weights)

    return _resnet(BasicBlock, [2, 2, 2, 2], weights, progress, **kwargs)

resnet34

resnet34(*, weights: Optional[ResNet34_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet

ResNet-34 from Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>__.

Parameters:

  • weights

    class:~torchvision.models.ResNet34_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.ResNet34_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.resnet.ResNet base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.

.. autoclass:: torchvision.models.ResNet34_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
@handle_legacy_interface(weights=("pretrained", ResNet34_Weights.IMAGENET1K_V1))
def resnet34(
    *, weights: Optional[ResNet34_Weights] = None, progress: bool = True, **kwargs: Any
) -> ResNet:
    """ResNet-34 from `Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>`__.

    Args:
        weights (:class:`~torchvision.models.ResNet34_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.ResNet34_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.ResNet34_Weights
        :members:
    """
    weights = ResNet34_Weights.verify(weights)

    return _resnet(BasicBlock, [3, 4, 6, 3], weights, progress, **kwargs)

resnet50

resnet50(*, weights: Optional[ResNet50_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet

ResNet-50 from Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>__.

.. note:: The bottleneck of TorchVision places the stride for downsampling to the second 3x3 convolution while the original paper places it to the first 1x1 convolution. This variant improves the accuracy and is known as ResNet V1.5 <https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>_.

Parameters:

  • weights

    class:~torchvision.models.ResNet50_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.ResNet50_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.resnet.ResNet base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.

.. autoclass:: torchvision.models.ResNet50_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
@handle_legacy_interface(weights=("pretrained", ResNet50_Weights.IMAGENET1K_V1))
def resnet50(
    *, weights: Optional[ResNet50_Weights] = None, progress: bool = True, **kwargs: Any
) -> ResNet:
    """ResNet-50 from `Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>`__.

    .. note::
       The bottleneck of TorchVision places the stride for downsampling to the second 3x3
       convolution while the original paper places it to the first 1x1 convolution.
       This variant improves the accuracy and is known as `ResNet V1.5
       <https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>`_.

    Args:
        weights (:class:`~torchvision.models.ResNet50_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.ResNet50_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.ResNet50_Weights
        :members:
    """
    weights = ResNet50_Weights.verify(weights)

    return _resnet(Bottleneck, [3, 4, 6, 3], weights, progress, **kwargs)

resnet101

resnet101(*, weights: Optional[ResNet101_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet

ResNet-101 from Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>__.

.. note:: The bottleneck of TorchVision places the stride for downsampling to the second 3x3 convolution while the original paper places it to the first 1x1 convolution. This variant improves the accuracy and is known as ResNet V1.5 <https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>_.

Parameters:

  • weights

    class:~torchvision.models.ResNet101_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.ResNet101_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.resnet.ResNet base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.

.. autoclass:: torchvision.models.ResNet101_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
@handle_legacy_interface(weights=("pretrained", ResNet101_Weights.IMAGENET1K_V1))
def resnet101(
    *, weights: Optional[ResNet101_Weights] = None, progress: bool = True, **kwargs: Any
) -> ResNet:
    """ResNet-101 from `Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>`__.

    .. note::
       The bottleneck of TorchVision places the stride for downsampling to the second 3x3
       convolution while the original paper places it to the first 1x1 convolution.
       This variant improves the accuracy and is known as `ResNet V1.5
       <https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>`_.

    Args:
        weights (:class:`~torchvision.models.ResNet101_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.ResNet101_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.ResNet101_Weights
        :members:
    """
    weights = ResNet101_Weights.verify(weights)

    return _resnet(Bottleneck, [3, 4, 23, 3], weights, progress, **kwargs)

resnet152

resnet152(*, weights: Optional[ResNet152_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet

ResNet-152 from Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>__.

.. note:: The bottleneck of TorchVision places the stride for downsampling to the second 3x3 convolution while the original paper places it to the first 1x1 convolution. This variant improves the accuracy and is known as ResNet V1.5 <https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>_.

Parameters:

  • weights

    class:~torchvision.models.ResNet152_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.ResNet152_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.resnet.ResNet base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.

.. autoclass:: torchvision.models.ResNet152_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
@handle_legacy_interface(weights=("pretrained", ResNet152_Weights.IMAGENET1K_V1))
def resnet152(
    *, weights: Optional[ResNet152_Weights] = None, progress: bool = True, **kwargs: Any
) -> ResNet:
    """ResNet-152 from `Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>`__.

    .. note::
       The bottleneck of TorchVision places the stride for downsampling to the second 3x3
       convolution while the original paper places it to the first 1x1 convolution.
       This variant improves the accuracy and is known as `ResNet V1.5
       <https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>`_.

    Args:
        weights (:class:`~torchvision.models.ResNet152_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.ResNet152_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.ResNet152_Weights
        :members:
    """
    weights = ResNet152_Weights.verify(weights)

    return _resnet(Bottleneck, [3, 8, 36, 3], weights, progress, **kwargs)

resnext50_32x4d

resnext50_32x4d(*, weights: Optional[ResNeXt50_32X4D_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet

ResNeXt-50 32x4d model from Aggregated Residual Transformation for Deep Neural Networks <https://arxiv.org/abs/1611.05431>_.

Parameters:

  • weights

    class:~torchvision.models.ResNeXt50_32X4D_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.ResNext50_32X4D_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.resnet.ResNet base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.

.. autoclass:: torchvision.models.ResNeXt50_32X4D_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
@handle_legacy_interface(weights=("pretrained", ResNeXt50_32X4D_Weights.IMAGENET1K_V1))
def resnext50_32x4d(
    *, weights: Optional[ResNeXt50_32X4D_Weights] = None, progress: bool = True, **kwargs: Any
) -> ResNet:
    """ResNeXt-50 32x4d model from
    `Aggregated Residual Transformation for Deep Neural Networks <https://arxiv.org/abs/1611.05431>`_.

    Args:
        weights (:class:`~torchvision.models.ResNeXt50_32X4D_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.ResNext50_32X4D_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.ResNeXt50_32X4D_Weights
        :members:
    """
    weights = ResNeXt50_32X4D_Weights.verify(weights)

    _ovewrite_named_param(kwargs, "groups", 32)
    _ovewrite_named_param(kwargs, "width_per_group", 4)
    return _resnet(Bottleneck, [3, 4, 6, 3], weights, progress, **kwargs)

resnext101_32x8d

resnext101_32x8d(*, weights: Optional[ResNeXt101_32X8D_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet

ResNeXt-101 32x8d model from Aggregated Residual Transformation for Deep Neural Networks <https://arxiv.org/abs/1611.05431>_.

Parameters:

  • weights

    class:~torchvision.models.ResNeXt101_32X8D_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.ResNeXt101_32X8D_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.resnet.ResNet base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.

.. autoclass:: torchvision.models.ResNeXt101_32X8D_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
@handle_legacy_interface(weights=("pretrained", ResNeXt101_32X8D_Weights.IMAGENET1K_V1))
def resnext101_32x8d(
    *, weights: Optional[ResNeXt101_32X8D_Weights] = None, progress: bool = True, **kwargs: Any
) -> ResNet:
    """ResNeXt-101 32x8d model from
    `Aggregated Residual Transformation for Deep Neural Networks <https://arxiv.org/abs/1611.05431>`_.

    Args:
        weights (:class:`~torchvision.models.ResNeXt101_32X8D_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.ResNeXt101_32X8D_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.ResNeXt101_32X8D_Weights
        :members:
    """
    weights = ResNeXt101_32X8D_Weights.verify(weights)

    _ovewrite_named_param(kwargs, "groups", 32)
    _ovewrite_named_param(kwargs, "width_per_group", 8)
    return _resnet(Bottleneck, [3, 4, 23, 3], weights, progress, **kwargs)

resnext101_64x4d

resnext101_64x4d(*, weights: Optional[ResNeXt101_64X4D_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet

ResNeXt-101 64x4d model from Aggregated Residual Transformation for Deep Neural Networks <https://arxiv.org/abs/1611.05431>_.

Parameters:

  • weights

    class:~torchvision.models.ResNeXt101_64X4D_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.ResNeXt101_64X4D_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.resnet.ResNet base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.

.. autoclass:: torchvision.models.ResNeXt101_64X4D_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
def resnext101_64x4d(
    *, weights: Optional[ResNeXt101_64X4D_Weights] = None, progress: bool = True, **kwargs: Any
) -> ResNet:
    """ResNeXt-101 64x4d model from
    `Aggregated Residual Transformation for Deep Neural Networks <https://arxiv.org/abs/1611.05431>`_.

    Args:
        weights (:class:`~torchvision.models.ResNeXt101_64X4D_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.ResNeXt101_64X4D_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.ResNeXt101_64X4D_Weights
        :members:
    """
    weights = ResNeXt101_64X4D_Weights.verify(weights)

    _ovewrite_named_param(kwargs, "groups", 64)
    _ovewrite_named_param(kwargs, "width_per_group", 4)
    return _resnet(Bottleneck, [3, 4, 23, 3], weights, progress, **kwargs)

wide_resnet50_2

wide_resnet50_2(*, weights: Optional[Wide_ResNet50_2_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet

Wide ResNet-50-2 model from Wide Residual Networks <https://arxiv.org/abs/1605.07146>_.

The model is the same as ResNet except for the bottleneck number of channels which is twice larger in every block. The number of channels in outer 1x1 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.

Parameters:

  • weights

    class:~torchvision.models.Wide_ResNet50_2_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.Wide_ResNet50_2_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.resnet.ResNet base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.

.. autoclass:: torchvision.models.Wide_ResNet50_2_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
@handle_legacy_interface(weights=("pretrained", Wide_ResNet50_2_Weights.IMAGENET1K_V1))
def wide_resnet50_2(
    *, weights: Optional[Wide_ResNet50_2_Weights] = None, progress: bool = True, **kwargs: Any
) -> ResNet:
    """Wide ResNet-50-2 model from
    `Wide Residual Networks <https://arxiv.org/abs/1605.07146>`_.

    The model is the same as ResNet except for the bottleneck number of channels
    which is twice larger in every block. The number of channels in outer 1x1
    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.

    Args:
        weights (:class:`~torchvision.models.Wide_ResNet50_2_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.Wide_ResNet50_2_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.Wide_ResNet50_2_Weights
        :members:
    """
    weights = Wide_ResNet50_2_Weights.verify(weights)

    _ovewrite_named_param(kwargs, "width_per_group", 64 * 2)
    return _resnet(Bottleneck, [3, 4, 6, 3], weights, progress, **kwargs)

wide_resnet101_2

wide_resnet101_2(*, weights: Optional[Wide_ResNet101_2_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet

Wide ResNet-101-2 model from Wide Residual Networks <https://arxiv.org/abs/1605.07146>_.

The model is the same as ResNet except for the bottleneck number of channels which is twice larger in every block. The number of channels in outer 1x1 convolutions is the same, e.g. last block in ResNet-101 has 2048-512-2048 channels, and in Wide ResNet-101-2 has 2048-1024-2048.

Parameters:

  • weights

    class:~torchvision.models.Wide_ResNet101_2_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.Wide_ResNet101_2_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.resnet.ResNet base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.

.. autoclass:: torchvision.models.Wide_ResNet101_2_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
@handle_legacy_interface(weights=("pretrained", Wide_ResNet101_2_Weights.IMAGENET1K_V1))
def wide_resnet101_2(
    *, weights: Optional[Wide_ResNet101_2_Weights] = None, progress: bool = True, **kwargs: Any
) -> ResNet:
    """Wide ResNet-101-2 model from
    `Wide Residual Networks <https://arxiv.org/abs/1605.07146>`_.

    The model is the same as ResNet except for the bottleneck number of channels
    which is twice larger in every block. The number of channels in outer 1x1
    convolutions is the same, e.g. last block in ResNet-101 has 2048-512-2048
    channels, and in Wide ResNet-101-2 has 2048-1024-2048.

    Args:
        weights (:class:`~torchvision.models.Wide_ResNet101_2_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.Wide_ResNet101_2_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
            for more details about this class.
    .. autoclass:: torchvision.models.Wide_ResNet101_2_Weights
        :members:
    """
    weights = Wide_ResNet101_2_Weights.verify(weights)

    _ovewrite_named_param(kwargs, "width_per_group", 64 * 2)
    return _resnet(Bottleneck, [3, 4, 23, 3], weights, progress, **kwargs)

squeezenet1_0

squeezenet1_0(*, weights: Optional[SqueezeNet1_0_Weights] = None, progress: bool = True, **kwargs: Any) -> SqueezeNet

SqueezeNet model architecture from the SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5MB model size <https://arxiv.org/abs/1602.07360>_ paper.

Parameters:

  • weights

    class:~torchvision.models.SqueezeNet1_0_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.SqueezeNet1_0_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.squeezenet.SqueezeNet base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/squeezenet.py>_ for more details about this class.

.. autoclass:: torchvision.models.SqueezeNet1_0_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/squeezenet.py
@handle_legacy_interface(weights=("pretrained", SqueezeNet1_0_Weights.IMAGENET1K_V1))
def squeezenet1_0(
    *, weights: Optional[SqueezeNet1_0_Weights] = None, progress: bool = True, **kwargs: Any
) -> SqueezeNet:
    """SqueezeNet model architecture from the `SqueezeNet: AlexNet-level
    accuracy with 50x fewer parameters and <0.5MB model size
    <https://arxiv.org/abs/1602.07360>`_ paper.

    Args:
        weights (:class:`~torchvision.models.SqueezeNet1_0_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.SqueezeNet1_0_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.squeezenet.SqueezeNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/squeezenet.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.SqueezeNet1_0_Weights
        :members:
    """
    weights = SqueezeNet1_0_Weights.verify(weights)
    return _squeezenet("1_0", weights, progress, **kwargs)

squeezenet1_1

squeezenet1_1(*, weights: Optional[SqueezeNet1_1_Weights] = None, progress: bool = True, **kwargs: Any) -> SqueezeNet

SqueezeNet 1.1 model from the official SqueezeNet repo <https://github.com/DeepScale/SqueezeNet/tree/master/SqueezeNet_v1.1>_.

SqueezeNet 1.1 has 2.4x less computation and slightly fewer parameters than SqueezeNet 1.0, without sacrificing accuracy.

Parameters:

  • weights

    class:~torchvision.models.SqueezeNet1_1_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.SqueezeNet1_1_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.squeezenet.SqueezeNet base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/squeezenet.py>_ for more details about this class.

.. autoclass:: torchvision.models.SqueezeNet1_1_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/squeezenet.py
@handle_legacy_interface(weights=("pretrained", SqueezeNet1_1_Weights.IMAGENET1K_V1))
def squeezenet1_1(
    *, weights: Optional[SqueezeNet1_1_Weights] = None, progress: bool = True, **kwargs: Any
) -> SqueezeNet:
    """SqueezeNet 1.1 model from the `official SqueezeNet repo
    <https://github.com/DeepScale/SqueezeNet/tree/master/SqueezeNet_v1.1>`_.

    SqueezeNet 1.1 has 2.4x less computation and slightly fewer parameters
    than SqueezeNet 1.0, without sacrificing accuracy.

    Args:
        weights (:class:`~torchvision.models.SqueezeNet1_1_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.SqueezeNet1_1_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.squeezenet.SqueezeNet``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/squeezenet.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.SqueezeNet1_1_Weights
        :members:
    """
    weights = SqueezeNet1_1_Weights.verify(weights)
    return _squeezenet("1_1", weights, progress, **kwargs)

vgg11

vgg11(*, weights: Optional[VGG11_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG

VGG-11 from Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>__.

Parameters:

  • weights

    class:~torchvision.models.VGG11_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.VGG11_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.vgg.VGG base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>_ for more details about this class.

.. autoclass:: torchvision.models.VGG11_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/vgg.py
@handle_legacy_interface(weights=("pretrained", VGG11_Weights.IMAGENET1K_V1))
def vgg11(*, weights: Optional[VGG11_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG:
    """VGG-11 from `Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>`__.

    Args:
        weights (:class:`~torchvision.models.VGG11_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.VGG11_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.vgg.VGG``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.VGG11_Weights
        :members:
    """
    weights = VGG11_Weights.verify(weights)

    return _vgg("A", False, weights, progress, **kwargs)

vgg11_bn

vgg11_bn(*, weights: Optional[VGG11_BN_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG

VGG-11-BN from Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>__.

Parameters:

  • weights

    class:~torchvision.models.VGG11_BN_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.VGG11_BN_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.vgg.VGG base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>_ for more details about this class.

.. autoclass:: torchvision.models.VGG11_BN_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/vgg.py
@handle_legacy_interface(weights=("pretrained", VGG11_BN_Weights.IMAGENET1K_V1))
def vgg11_bn(*, weights: Optional[VGG11_BN_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG:
    """VGG-11-BN from `Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>`__.

    Args:
        weights (:class:`~torchvision.models.VGG11_BN_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.VGG11_BN_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.vgg.VGG``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.VGG11_BN_Weights
        :members:
    """
    weights = VGG11_BN_Weights.verify(weights)

    return _vgg("A", True, weights, progress, **kwargs)

vgg13

vgg13(*, weights: Optional[VGG13_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG

VGG-13 from Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>__.

Parameters:

  • weights

    class:~torchvision.models.VGG13_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.VGG13_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.vgg.VGG base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>_ for more details about this class.

.. autoclass:: torchvision.models.VGG13_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/vgg.py
@handle_legacy_interface(weights=("pretrained", VGG13_Weights.IMAGENET1K_V1))
def vgg13(*, weights: Optional[VGG13_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG:
    """VGG-13 from `Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>`__.

    Args:
        weights (:class:`~torchvision.models.VGG13_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.VGG13_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.vgg.VGG``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.VGG13_Weights
        :members:
    """
    weights = VGG13_Weights.verify(weights)

    return _vgg("B", False, weights, progress, **kwargs)

vgg13_bn

vgg13_bn(*, weights: Optional[VGG13_BN_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG

VGG-13-BN from Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>__.

Parameters:

  • weights

    class:~torchvision.models.VGG13_BN_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.VGG13_BN_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.vgg.VGG base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>_ for more details about this class.

.. autoclass:: torchvision.models.VGG13_BN_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/vgg.py
@handle_legacy_interface(weights=("pretrained", VGG13_BN_Weights.IMAGENET1K_V1))
def vgg13_bn(*, weights: Optional[VGG13_BN_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG:
    """VGG-13-BN from `Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>`__.

    Args:
        weights (:class:`~torchvision.models.VGG13_BN_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.VGG13_BN_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.vgg.VGG``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.VGG13_BN_Weights
        :members:
    """
    weights = VGG13_BN_Weights.verify(weights)

    return _vgg("B", True, weights, progress, **kwargs)

vgg16

vgg16(*, weights: Optional[VGG16_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG

VGG-16 from Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>__.

Parameters:

  • weights

    class:~torchvision.models.VGG16_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.VGG16_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.vgg.VGG base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>_ for more details about this class.

.. autoclass:: torchvision.models.VGG16_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/vgg.py
@handle_legacy_interface(weights=("pretrained", VGG16_Weights.IMAGENET1K_V1))
def vgg16(*, weights: Optional[VGG16_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG:
    """VGG-16 from `Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>`__.

    Args:
        weights (:class:`~torchvision.models.VGG16_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.VGG16_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.vgg.VGG``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.VGG16_Weights
        :members:
    """
    weights = VGG16_Weights.verify(weights)

    return _vgg("D", False, weights, progress, **kwargs)

vgg16_bn

vgg16_bn(*, weights: Optional[VGG16_BN_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG

VGG-16-BN from Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>__.

Parameters:

  • weights

    class:~torchvision.models.VGG16_BN_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.VGG16_BN_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.vgg.VGG base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>_ for more details about this class.

.. autoclass:: torchvision.models.VGG16_BN_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/vgg.py
@handle_legacy_interface(weights=("pretrained", VGG16_BN_Weights.IMAGENET1K_V1))
def vgg16_bn(*, weights: Optional[VGG16_BN_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG:
    """VGG-16-BN from `Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>`__.

    Args:
        weights (:class:`~torchvision.models.VGG16_BN_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.VGG16_BN_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.vgg.VGG``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.VGG16_BN_Weights
        :members:
    """
    weights = VGG16_BN_Weights.verify(weights)

    return _vgg("D", True, weights, progress, **kwargs)

vgg19

vgg19(*, weights: Optional[VGG19_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG

VGG-19 from Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>__.

Parameters:

  • weights

    class:~torchvision.models.VGG19_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.VGG19_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.vgg.VGG base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>_ for more details about this class.

.. autoclass:: torchvision.models.VGG19_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/vgg.py
@handle_legacy_interface(weights=("pretrained", VGG19_Weights.IMAGENET1K_V1))
def vgg19(*, weights: Optional[VGG19_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG:
    """VGG-19 from `Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>`__.

    Args:
        weights (:class:`~torchvision.models.VGG19_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.VGG19_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.vgg.VGG``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.VGG19_Weights
        :members:
    """
    weights = VGG19_Weights.verify(weights)

    return _vgg("E", False, weights, progress, **kwargs)

vgg19_bn

vgg19_bn(*, weights: Optional[VGG19_BN_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG

VGG-19_BN from Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>__.

Parameters:

  • weights

    class:~torchvision.models.VGG19_BN_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.VGG19_BN_Weights below for more details, and possible values. By default, no pre-trained weights are used.

  • progress (bool, default: True ) –

    If True, displays a progress bar of the download to stderr. Default is True.

  • **kwargs (Any, default: {} ) –

    parameters passed to the torchvision.models.vgg.VGG base class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>_ for more details about this class.

.. autoclass:: torchvision.models.VGG19_BN_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/vgg.py
@handle_legacy_interface(weights=("pretrained", VGG19_BN_Weights.IMAGENET1K_V1))
def vgg19_bn(*, weights: Optional[VGG19_BN_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG:
    """VGG-19_BN from `Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>`__.

    Args:
        weights (:class:`~torchvision.models.VGG19_BN_Weights`, optional): The
            pretrained weights to use. See
            :class:`~torchvision.models.VGG19_BN_Weights` below for
            more details, and possible values. By default, no pre-trained
            weights are used.
        progress (bool, optional): If True, displays a progress bar of the
            download to stderr. Default is True.
        **kwargs: parameters passed to the ``torchvision.models.vgg.VGG``
            base class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>`_
            for more details about this class.

    .. autoclass:: torchvision.models.VGG19_BN_Weights
        :members:
    """
    weights = VGG19_BN_Weights.verify(weights)

    return _vgg("E", True, weights, progress, **kwargs)

register_backbone

register_backbone(backbone, name: Optional[str] = None)

native_models에 백본을 등록해 build_backbone()에서 사용할 수 있도록 합니다

Source code in SaigeToolkit/model/backbone/builder.py
def register_backbone(backbone, name: Optional[str] = None):
    """`native_models`에 백본을 등록해 `build_backbone()`에서 사용할 수 있도록 합니다"""
    name = name or backbone.__name__
    if name in native_models and backbone != native_models[name]:
        raise ValueError(f"backbone name {name} already exists.")
    native_models[name] = backbone

build_backbone

build_backbone(_target_: str, **params) -> Module
Source code in SaigeToolkit/model/backbone/builder.py
def build_backbone(_target_: str, **params) -> nn.Module:
    if _target_ in native_models:
        builder = native_models[_target_]
    elif _target_.startswith("torchvision.models."):
        builder = getattr(torchvision.models, _target_.split(".")[-1])
    elif _target_ == "timm.create_model":
        import timm

        builder = timm.create_model
    elif _target_ == "torch.hub.load":
        builder = torch.hub.load
    else:
        raise ValueError(f"Unknown backbone target: {_target_}")

    return builder(**params)