flowvision.models

Pretrain Models for Visual Tasks

Classification

The models subpackage contains definitions for the following model architectures for image classification:

Alexnet

flowvision.models.alexnet(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.alexnet.AlexNet[source]

Constructs the AlexNet model.

Note

AlexNet model architecture from the One weird trick… paper. The required minimum input size of this model is 63x63.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> alexnet = flowvision.models.alexnet(pretrained=False, progress=True)

SqueezeNet

flowvision.models.squeezenet1_0(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.squeezenet.SqueezeNet[source]

Constructs the SqueezeNet model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> squeezenet1_0 = flowvision.models.squeezenet1_0(pretrained=False, progress=True)
flowvision.models.squeezenet1_1(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.squeezenet.SqueezeNet[source]

Constructs the SqueezeNet 1.1 model.

Note

SqueezeNet 1.1 model from the SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5MB model size paper. Note that SqueezeNet 1.1 has 2.4x less computation and slightly fewer parameters than SqueezeNet 1.0, without sacrificing accuracy.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> squeezenet1_1 = flowvision.models.squeezenet1_1(pretrained=False, progress=True)

VGG

flowvision.models.vgg11(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.vgg.VGG[source]

Constructs the VGG-11 model (configuration “A”).

Note

VGG 11-layer model (configuration “A”) from “Very Deep Convolutional Networks For Large-Scale Image Recognition”. The required minimum input size of the model is 32x32.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vgg11 = flowvision.models.vgg11(pretrained=False, progress=True)
flowvision.models.vgg11_bn(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.vgg.VGG[source]

Constructs the VGG-11 model with batch normalization (configuration “A”).

Note

VGG 11-layer model (configuration “A”) with batch normalization “Very Deep Convolutional Networks For Large-Scale Image Recognition”. The required minimum input size of the model is 32x32.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vgg11_bn = flowvision.models.vgg11_bn(pretrained=False, progress=True)
flowvision.models.vgg13(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.vgg.VGG[source]

Constructs the VGG-13 model (configuration “B”).

Note

VGG 13-layer model (configuration “B”) from “Very Deep Convolutional Networks For Large-Scale Image Recognition”. The required minimum input size of the model is 32x32.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vgg13 = flowvision.models.vgg13(pretrained=False, progress=True)
flowvision.models.vgg13_bn(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.vgg.VGG[source]

Constructs the VGG-13 model with batch normalization (configuration “B”).

Note

VGG 13-layer model (configuration “B”) with batch normalization from “Very Deep Convolutional Networks For Large-Scale Image Recognition”. The required minimum input size of the model is 32x32.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vgg13_bn = flowvision.models.vgg13_bn(pretrained=False, progress=True)
flowvision.models.vgg16(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.vgg.VGG[source]

Constructs the VGG-16 model (configuration “D”).

Note

VGG 16-layer model (configuration “D”) from “Very Deep Convolutional Networks For Large-Scale Image Recognition”. The required minimum input size of the model is 32x32.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vgg16 = flowvision.models.vgg16(pretrained=False, progress=True)
flowvision.models.vgg16_bn(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.vgg.VGG[source]

Constructs the VGG-16 model (configuration “D”) with batch normalization.

Note

VGG 16-layer model (configuration “D”) with batch normalization from “Very Deep Convolutional Networks For Large-Scale Image Recognition”. The required minimum input size of the model is 32x32.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vgg16_bn = flowvision.models.vgg16_bn(pretrained=False, progress=True)
flowvision.models.vgg19(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.vgg.VGG[source]

Constructs the VGG-19 model (configuration “E”).

Note

VGG 19-layer model (configuration “E”) from “Very Deep Convolutional Networks For Large-Scale Image Recognition”. The required minimum input size of the model is 32x32.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vgg19 = flowvision.models.vgg19(pretrained=False, progress=True)
flowvision.models.vgg19_bn(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.vgg.VGG[source]

Constructs the VGG-19 model (configuration “E”) with batch normalization.

Note

VGG 19-layer model (configuration “E”) with batch normalization from “Very Deep Convolutional Networks For Large-Scale Image Recognition”. The required minimum input size of the model is 32x32.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vgg19_bn = flowvision.models.vgg19_bn(pretrained=False, progress=True)

GoogLeNet

flowvision.models.googlenet(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.googlenet.GoogLeNet[source]

Constructs the GoogLeNet (Inception v1) model.

Note

GoogLeNet (Inception v1) model from the Going Deeper with Convolutions paper. The required minimum input size of the model is 15x15.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

  • aux_logits (bool) – If True, adds two auxiliary branches that can improve training. Default: False when pretrained is True otherwise True

  • transform_input (bool) – If True, preprocesses the input according to the method with which it was trained on ImageNet. Default: False

For example:

>>> import flowvision
>>> googlenet = flowvision.models.googlenet(pretrained=False, progress=True)

InceptionV3

flowvision.models.inception_v3(pretrained: bool = False, progress: bool = True, **kwargs: Any)[source]

Constructs Inception v3 model.

Note

Inception v3 model from the Rethinking the Inception Architecture for Computer Vision paper. In contrast to the other models the inception_v3 expects tensors with a size of N x 3 x 299 x 299, so ensure your images are sized accordingly.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

  • aux_logits (bool) – If True, add an auxiliary branch that can improve training. Default: True

  • transform_input (bool) – If True, preprocesses the input according to the method with which it was trained on ImageNet. Default: False

For example:

>>> import flowvision
>>> inception_v3 = flowvision.models.inception_v3(pretrained=False, progress=True)

ResNet

flowvision.models.resnet101(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.resnet.ResNet[source]

Constructs the ResNet-101 model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resnet101 = flowvision.models.resnet101(pretrained=False, progress=True)
flowvision.models.resnet152(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.resnet.ResNet[source]

Constructs the ResNet-152 model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resnet152 = flowvision.models.resnet152(pretrained=False, progress=True)
flowvision.models.resnet18(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.resnet.ResNet[source]

Constructs the ResNet-18 model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resnet18 = flowvision.models.resnet18(pretrained=False, progress=True)
flowvision.models.resnet34(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.resnet.ResNet[source]

Constructs the ResNet-34 model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resnet34 = flowvision.models.resnet34(pretrained=False, progress=True)
flowvision.models.resnet50(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.resnet.ResNet[source]

Constructs the ResNet-50 model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resnet50 = flowvision.models.resnet50(pretrained=False, progress=True)
flowvision.models.resnext101_32x8d(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.resnet.ResNet[source]

Constructs the ResNeXt-101 32x8d model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resnext101_32x8d = flowvision.models.resnext101_32x8d(pretrained=False, progress=True)
flowvision.models.resnext50_32x4d(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.resnet.ResNet[source]

Constructs the ResNeXt-50 32x4d model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resnext50_32x4d = flowvision.models.resnext50_32x4d(pretrained=False, progress=True)
flowvision.models.wide_resnet101_2(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.resnet.ResNet[source]

Constructs the Wide ResNet-101-2 model.

Note

Wide Residual Networks. 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.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> wide_resnet101_2 = flowvision.models.wide_resnet101_2(pretrained=False, progress=True)
flowvision.models.wide_resnet50_2(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.resnet.ResNet[source]

Constructs the Wide ResNet-50-2 model.

Note

Wide Residual Networks. 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
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> wide_resnet50_2 = flowvision.models.wide_resnet50_2(pretrained=False, progress=True)

ResNeSt

flowvision.models.resnest101(pretrained=False, progress=True, **kwargs)[source]

Constructs the ResNeSt-101 model trained on ImageNet2012.

Note

ResNeSt-101 model from “ResNeSt: Split-Attention Networks” <https://arxiv.org/abs/2004.08955> _. The required input size of the model is 256x256.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resnest101 = flowvision.models.resnest101(pretrained=False, progress=True)
flowvision.models.resnest200(pretrained=False, progress=True, **kwargs)[source]

Constructs the ResNeSt-200 model trained on ImageNet2012.

Note

ResNeSt-200 model from “ResNeSt: Split-Attention Networks” <https://arxiv.org/abs/2004.08955> _. The required input size of the model is 320x320.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resnest200 = flowvision.models.resnest200(pretrained=False, progress=True)
flowvision.models.resnest269(pretrained=False, progress=True, **kwargs)[source]

Constructs the ResNeSt-269 model trained on ImageNet2012.

Note

ResNeSt-269 model from “ResNeSt: Split-Attention Networks” <https://arxiv.org/abs/2004.08955> _. The required input size of the model is 416x416.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resnest269 = flowvision.models.resnest269(pretrained=False, progress=True)
flowvision.models.resnest50(pretrained=False, progress=True, **kwargs)[source]

Constructs the ResNeSt-50 model trained on ImageNet2012.

Note

ResNeSt-50 model from “ResNeSt: Split-Attention Networks” <https://arxiv.org/abs/2004.08955> _. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resnest50 = flowvision.models.resnest50(pretrained=False, progress=True)

DenseNet

flowvision.models.densenet121(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.densenet.DenseNet[source]

Constructs the DenseNet-121 model.

Note

DenseNet-121 model architecture from the Densely Connected Convolutional Networks paper. The required minimum input size of the model is 29x29.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> densenet121 = flowvision.models.densenet121(pretrained=False, progress=True)
flowvision.models.densenet161(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.densenet.DenseNet[source]

Constructs the DenseNet-161 model.

Note

DenseNet-161 model architecture from the Densely Connected Convolutional Networks paper. The required minimum input size of the model is 29x29.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> densenet161 = flowvision.models.densenet161(pretrained=False, progress=True)
flowvision.models.densenet169(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.densenet.DenseNet[source]

Constructs the DenseNet-169 model.

Note

DenseNet-169 model architecture from the Densely Connected Convolutional Networks paper. The required minimum input size of the model is 29x29.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> densenet169 = flowvision.models.densenet169(pretrained=False, progress=True)
flowvision.models.densenet201(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.densenet.DenseNet[source]

Constructs the DenseNet-201 model.

Note

DenseNet-201 model architecture from the Densely Connected Convolutional Networks paper. The required minimum input size of the model is 29x29.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> densenet201 = flowvision.models.densenet201(pretrained=False, progress=True)

ShuffleNetV2

flowvision.models.shufflenet_v2_x0_5(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.shufflenet_v2.ShuffleNetV2[source]

Constructs the ShuffleNetV2(0.5x) model.

Note

ShuffleNetV2 with 0.5x output channels model architecture from the ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> shufflenet_v2_x0_5 = flowvision.models.shufflenet_v2_x0_5(pretrained=False, progress=True)
flowvision.models.shufflenet_v2_x1_0(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.shufflenet_v2.ShuffleNetV2[source]

Constructs the ShuffleNetV2(1.0x) model.

Note

ShuffleNetV2 with 1.0x output channels model architecture from the ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> shufflenet_v2_x1_0 = flowvision.models.shufflenet_v2_x1_0(pretrained=False, progress=True)
flowvision.models.shufflenet_v2_x1_5(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.shufflenet_v2.ShuffleNetV2[source]

Constructs the ShuffleNetV2(1.5x) model.

Note

ShuffleNetV2 with 1.5x output channels model architecture from the ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> shufflenet_v2_x1_5 = flowvision.models.shufflenet_v2_x1_5(pretrained=False, progress=True)
flowvision.models.shufflenet_v2_x2_0(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.shufflenet_v2.ShuffleNetV2[source]

Constructs the ShuffleNetV2(2.0x) model.

Note

ShuffleNetV2 with 2.0x output channels model architecture from the ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> shufflenet_v2_x2_0 = flowvision.models.shufflenet_v2_x2_0(pretrained=False, progress=True)

MobileNetV2

flowvision.models.mobilenet_v2(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.mobilenet_v2.MobileNetV2[source]

Constructs the MobileNetV2 model.

Note

MobileNetV2 model architecture from the MobileNetV2: Inverted Residuals and Linear Bottlenecks paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mobilenet_v2 = flowvision.models.mobilenet_v2(pretrained=False, progress=True)

MobileNetV3

flowvision.models.mobilenet_v3_large(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.mobilenet_v3.MobileNetV3[source]

Constructs the MobileNetV3-Large model.

Note

MobileNetV3-Large model architecture from the Searching for MobileNetV3 paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mobilenet_v3_large = flowvision.models.mobilenet_v3_large(pretrained=False, progress=True)
flowvision.models.mobilenet_v3_small(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.mobilenet_v3.MobileNetV3[source]

Constructs the MobileNetV3-Small model.

Note

MobileNetV3-Small model architecture from the Searching for MobileNetV3 paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mobilenet_v3_small = flowvision.models.mobilenet_v3_small(pretrained=False, progress=True)

MNASNet

flowvision.models.mnasnet0_5(pretrained=False, progress=True, **kwargs)[source]

Constructs the MNASNet model with depth multiplier of 0.5.

Note

MNASNet model with depth multiplier of 0.5 from the MnasNet: Platform-Aware Neural Architecture Search for Mobile paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mnasnet0_5 = flowvision.models.mnasnet0_5(pretrained=False, progress=True)
flowvision.models.mnasnet0_75(pretrained=False, progress=True, **kwargs)[source]

Constructs the MNASNet model with depth multiplier of 0.75.

Note

MNASNet model with depth multiplier of 0.75 from the MnasNet: Platform-Aware Neural Architecture Search for Mobile paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mnasnet0_75 = flowvision.models.mnasnet0_75(pretrained=False, progress=True)
flowvision.models.mnasnet1_0(pretrained=False, progress=True, **kwargs)[source]

Constructs the MNASNet model with depth multiplier of 1.0.

Note

MNASNet model with depth multiplier of 1.0 from the MnasNet: Platform-Aware Neural Architecture Search for Mobile paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mnasnet1_0 = flowvision.models.mnasnet1_0(pretrained=False, progress=True)
flowvision.models.mnasnet1_3(pretrained=False, progress=True, **kwargs)[source]

Constructs the MNASNet model with depth multiplier of 1.3.

Note

MNASNet model with depth multiplier of 1.3 from the MnasNet: Platform-Aware Neural Architecture Search for Mobile paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mnasnet1_3 = flowvision.models.mnasnet1_3(pretrained=False, progress=True)

GhostNet

flowvision.models.ghostnet(pretrained: bool = False, progress: bool = True, **kwargs: Any)[source]

Constructs the GhostNet model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> ghostnet = flowvision.models.ghostnet(pretrained=True, progress=True)

Res2Net

flowvision.models.res2net101_26w_4s(pretrained=False, progress=True, **kwargs)[source]

Constructs the Res2Net-101_26w_4s model.

Note

Res2Net-101_26w_4s model from the Res2Net: A New Multi-scale Backbone Architecture paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> res2net101_26w_4s = flowvision.models.res2net101_26w_4s(pretrained=False, progress=True)
flowvision.models.res2net50_14w_8s(pretrained=False, progress=True, **kwargs)[source]

Constructs the Res2Net-50_14w_8s model.

Note

Res2Net-50_14w_8s model from the Res2Net: A New Multi-scale Backbone Architecture paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> res2net50_14w_8s = flowvision.models.res2net50_14w_8s(pretrained=False, progress=True)
flowvision.models.res2net50_26w_4s(pretrained=False, progress=True, **kwargs)[source]

Constructs the Res2Net-50_26w_4s model.

Note

Res2Net-50_26w_4s model from the Res2Net: A New Multi-scale Backbone Architecture paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> res2net50_26w_4s = flowvision.models.res2net50_26w_4s(pretrained=False, progress=True)
flowvision.models.res2net50_26w_6s(pretrained=False, progress=True, **kwargs)[source]

Constructs the Res2Net-50_26w_6s model.

Note

Res2Net-50_26w_6s model from the Res2Net: A New Multi-scale Backbone Architecture paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> res2net50_26w_6s = flowvision.models.res2net50_26w_6s(pretrained=False, progress=True)
flowvision.models.res2net50_26w_8s(pretrained=False, progress=True, **kwargs)[source]

Constructs the Res2Net-50_26w_8s model.

Note

Res2Net-50_26w_8s model from the Res2Net: A New Multi-scale Backbone Architecture paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> res2net50_26w_8s = flowvision.models.res2net50_26w_8s(pretrained=False, progress=True)
flowvision.models.res2net50_48w_2s(pretrained=False, progress=True, **kwargs)[source]

Constructs the Res2Net-50_48w_2s model.

Note

Res2Net-50_48w_2s model from the Res2Net: A New Multi-scale Backbone Architecture paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> res2net50_48w_2s = flowvision.models.res2net50_48w_2s(pretrained=False, progress=True)

EfficientNet

flowvision.models.efficientnet_b0(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.efficientnet.EfficientNet[source]

Constructs the EfficientNet B0 model.

Note

EfficientNet B0 model architecture from the EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks paper. Note that the (resize-size, crop-size) should be (256, 224) for efficientnet-b0 model when training and testing.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> efficientnet_b0 = flowvision.models.efficientnet_b0(pretrained=False, progress=True)
flowvision.models.efficientnet_b1(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.efficientnet.EfficientNet[source]

Constructs the EfficientNet B1 model.

Note

EfficientNet B1 model architecture from the EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks paper. Note that the (resize-size, crop-size) should be (256, 240) for efficientnet-b1 model when training and testing.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> efficientnet_b1 = flowvision.models.efficientnet_b1(pretrained=False, progress=True)
flowvision.models.efficientnet_b2(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.efficientnet.EfficientNet[source]

Constructs the EfficientNet B2 model.

Note

EfficientNet B2 model architecture from the EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks paper. Note that the (resize-size, crop-size) should be (288, 288) for efficientnet-b2 model when training and testing.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> efficientnet_b2 = flowvision.models.efficientnet_b2(pretrained=False, progress=True)
flowvision.models.efficientnet_b3(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.efficientnet.EfficientNet[source]

Constructs the EfficientNet B3 model.

Note

EfficientNet B3 model architecture from the EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks paper. Note that the (resize-size, crop-size) should be (320, 300) for efficientnet-b3 model when training and testing.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> efficientnet_b3 = flowvision.models.efficientnet_b3(pretrained=False, progress=True)
flowvision.models.efficientnet_b4(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.efficientnet.EfficientNet[source]

Constructs the EfficientNet B4 model.

Note

EfficientNet B4 model architecture from the EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks paper. Note that the (resize-size, crop-size) should be (384, 380) for efficientnet-b4 model when training and testing.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> efficientnet_b4 = flowvision.models.efficientnet_b4(pretrained=False, progress=True)
flowvision.models.efficientnet_b5(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.efficientnet.EfficientNet[source]

Constructs the EfficientNet B5 model.

Note

EfficientNet B5 model architecture from the EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks paper. Note that the (resize-size, crop-size) should be (489, 456) for efficientnet-b5 model when training and testing.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> efficientnet_b5 = flowvision.models.efficientnet_b5(pretrained=False, progress=True)
flowvision.models.efficientnet_b6(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.efficientnet.EfficientNet[source]

Constructs the EfficientNet B6 model.

Note

EfficientNet B6 model architecture from the EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks paper. Note that the (resize-size, crop-size) should be (561, 528) for efficientnet-b6 model when training and testing.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> efficientnet_b6 = flowvision.models.efficientnet_b6(pretrained=False, progress=True)
flowvision.models.efficientnet_b7(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.efficientnet.EfficientNet[source]

Constructs the EfficientNet B7 model.

Note

EfficientNet B7 model architecture from the EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks paper. Note that the (resize-size, crop-size) should be (633, 600) for efficientnet-b7 model when training and testing.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> efficientnet_b7 = flowvision.models.efficientnet_b7(pretrained=False, progress=True)

RegNet

flowvision.models.regnet_x_16gf(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.regnet.RegNet[source]

Constructs a RegNetX-16GF architecture from “Designing Network Design Spaces”.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regnet_x_16gf = flowvision.models.regnet_x_16gf(pretrained=False, progress=True)
flowvision.models.regnet_x_1_6gf(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.regnet.RegNet[source]

Constructs a RegNetX-1.6GF architecture from “Designing Network Design Spaces”.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regnet_x_1_6gf = flowvision.models.regnet_x_1_6gf(pretrained=False, progress=True)
flowvision.models.regnet_x_32gf(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.regnet.RegNet[source]

Constructs a RegNetX-32GF architecture from “Designing Network Design Spaces”.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regnet_x_32gf = flowvision.models.regnet_x_32gf(pretrained=False, progress=True)
flowvision.models.regnet_x_3_2gf(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.regnet.RegNet[source]

Constructs a RegNetX-3.2GF architecture from “Designing Network Design Spaces”.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regnet_x_3_2gf = flowvision.models.regnet_x_3_2gf(pretrained=False, progress=True)
flowvision.models.regnet_x_400mf(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.regnet.RegNet[source]

Constructs a RegNetX-400MF architecture from “Designing Network Design Spaces”.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regnet_x_400mf = flowvision.models.regnet_x_400mf(pretrained=False, progress=True)
flowvision.models.regnet_x_800mf(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.regnet.RegNet[source]

Constructs a RegNetX-800MF architecture from “Designing Network Design Spaces”.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regnet_x_800mf = flowvision.models.regnet_x_800mf(pretrained=False, progress=True)
flowvision.models.regnet_x_8gf(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.regnet.RegNet[source]

Constructs a RegNetX-8GF architecture from “Designing Network Design Spaces”.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regnet_x_8gf = flowvision.models.regnet_x_8gf(pretrained=False, progress=True)
flowvision.models.regnet_y_16gf(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.regnet.RegNet[source]

Constructs a RegNetY-16GF architecture from “Designing Network Design Spaces”.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regnet_y_16gf = flowvision.models.regnet_y_16gf(pretrained=False, progress=True)
flowvision.models.regnet_y_1_6gf(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.regnet.RegNet[source]

Constructs a RegNetY-1.6GF architecture from “Designing Network Design Spaces”.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regnet_y_1_6gf = flowvision.models.regnet_y_1_6gf(pretrained=False, progress=True)
flowvision.models.regnet_y_32gf(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.regnet.RegNet[source]

Constructs a RegNetY-32GF architecture from “Designing Network Design Spaces”.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regnet_y_32gf = flowvision.models.regnet_y_32gf(pretrained=False, progress=True)
flowvision.models.regnet_y_3_2gf(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.regnet.RegNet[source]

Constructs a RegNetY-3.2GF architecture from “Designing Network Design Spaces”.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regnet_y_3_2gf = flowvision.models.regnet_y_3_2gf(pretrained=False, progress=True)
flowvision.models.regnet_y_400mf(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.regnet.RegNet[source]

Constructs a RegNetY-400MF architecture from “Designing Network Design Spaces”.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regnet_y_400mf = flowvision.models.regnet_y_400mf(pretrained=False, progress=True)
flowvision.models.regnet_y_800mf(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.regnet.RegNet[source]

Constructs a RegNetY-800MF architecture from “Designing Network Design Spaces”.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regnet_y_800mf = flowvision.models.regnet_y_800mf(pretrained=False, progress=True)
flowvision.models.regnet_y_8gf(pretrained: bool = False, progress: bool = True, **kwargs: Any)flowvision.models.regnet.RegNet[source]

Constructs a RegNetY-8GF architecture from “Designing Network Design Spaces”.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regnet_y_8gf = flowvision.models.regnet_y_8gf(pretrained=False, progress=True)

ReXNet

flowvision.models.rexnetv1_1_0(pretrained=False, progress=True, **kwargs)[source]

Constructs the ReXNet model with width multiplier of 1.0.

Note

ReXNet model with width multiplier of 1.0 from the Rethinking Channel Dimensions for Efficient Model Design paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> rexnetv1_1_0 = flowvision.models.rexnetv1_1_0(pretrained=False, progress=True)
flowvision.models.rexnetv1_1_3(pretrained=False, progress=True, **kwargs)[source]

Constructs the ReXNet model with width multiplier of 1.3.

Note

ReXNet model with width multiplier of 1.3 from the Rethinking Channel Dimensions for Efficient Model Design paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> rexnetv1_1_3 = flowvision.models.rexnetv1_1_3(pretrained=False, progress=True)
flowvision.models.rexnetv1_1_5(pretrained=False, progress=True, **kwargs)[source]

Constructs the ReXNet model with width multiplier of 1.5.

Note

ReXNet model with width multiplier of 1.5 from the Rethinking Channel Dimensions for Efficient Model Design paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> rexnetv1_1_5 = flowvision.models.rexnetv1_1_5(pretrained=False, progress=True)
flowvision.models.rexnetv1_2_0(pretrained=False, progress=True, **kwargs)[source]

Constructs the ReXNet model with width multiplier of 2.0.

Note

ReXNet model with width multiplier of 2.0 from the Rethinking Channel Dimensions for Efficient Model Design paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> rexnetv1_2_0 = flowvision.models.rexnetv1_2_0(pretrained=False, progress=True)
flowvision.models.rexnetv1_3_0(pretrained=False, progress=True, **kwargs)[source]

Constructs the ReXNet model with width multiplier of 3.0.

Note

ReXNet model with width multiplier of 3.0 from the Rethinking Channel Dimensions for Efficient Model Design paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> rexnetv1_3_0 = flowvision.models.rexnetv1_3_0(pretrained=False, progress=True)
flowvision.models.rexnet_lite_1_0(pretrained=False, progress=True, **kwargs)[source]

Constructs the ReXNet-lite model with width multiplier of 1.0.

Note

ReXNet-lite model with width multiplier of 1.0 from the Rethinking Channel Dimensions for Efficient Model Design paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> rexnet_lite_1_0 = flowvision.models.rexnet_lite_1_0(pretrained=False, progress=True)
flowvision.models.rexnet_lite_1_3(pretrained=False, progress=True, **kwargs)[source]

Constructs the ReXNet-lite model with width multiplier of 1.3.

Note

ReXNet-lite model with width multiplier of 1.3 from the Rethinking Channel Dimensions for Efficient Model Design paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> rexnet_lite_1_3 = flowvision.models.rexnet_lite_1_3(pretrained=False, progress=True)
flowvision.models.rexnet_lite_1_5(pretrained=False, progress=True, **kwargs)[source]

Constructs the ReXNet-lite model with width multiplier of 1.5.

Note

ReXNet-lite model with width multiplier of 1.5 from the Rethinking Channel Dimensions for Efficient Model Design paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> rexnet_lite_1_5 = flowvision.models.rexnet_lite_1_5(pretrained=False, progress=True)
flowvision.models.rexnet_lite_2_0(pretrained=False, progress=True, **kwargs)[source]

Constructs the ReXNet-lite model with width multiplier of 2.0.

Note

ReXNet-lite model with width multiplier of 2.0 from the Rethinking Channel Dimensions for Efficient Model Design paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> rexnet_lite_2_0 = flowvision.models.rexnet_lite_2_0(pretrained=False, progress=True)

SENet

flowvision.models.se_resnet101(pretrained=False, progress=True, **kwargs)[source]

Constructs the SE-ResNet101 model trained on ImageNet2012.

Note

SE-ResNet101 model from Squeeze-and-Excitation Networks. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> se_resnet101 = flowvision.models.se_resnet101(pretrained=False, progress=True)
flowvision.models.se_resnet152(pretrained=False, progress=True, **kwargs)[source]

Constructs the SE-ResNet152 model trained on ImageNet2012.

Note

SE-ResNet152 model Squeeze-and-Excitation Networks. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> se_resnet152 = flowvision.models.se_resnet152(pretrained=False, progress=True)
flowvision.models.se_resnet50(pretrained=False, progress=True, **kwargs)[source]

Constructs the SE-ResNet50 model trained on ImageNet2012.

Note

SE-ResNet50 model from Squeeze-and-Excitation Networks. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> se_resnet50 = flowvision.models.se_resnet50(pretrained=False, progress=True)
flowvision.models.se_resnext101_32x4d(pretrained=False, progress=True, **kwargs)[source]

Constructs the SE-ResNeXt101-32x4d model trained on ImageNet2012.

Note

SE-ResNeXt101-32x4d model from Squeeze-and-Excitation Networks. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> se_resnext101_32x4d = flowvision.models.se_resnext101_32x4d(pretrained=False, progress=True)
flowvision.models.se_resnext50_32x4d(pretrained=False, progress=True, **kwargs)[source]

Constructs the SE-ResNeXt50-32x4d model trained on ImageNet2012.

Note

SE-ResNeXt50-32x4d model from Squeeze-and-Excitation Networks. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> se_resnext50_32x4d = flowvision.models.se_resnext50_32x4d(pretrained=False, progress=True)
flowvision.models.senet154(pretrained=False, progress=True, **kwargs)[source]

Constructs the SENet-154 model trained on ImageNet2012.

Note

seneSENet-154t154 model from Squeeze-and-Excitation Networks. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> senet154 = flowvision.models.senet154(pretrained=False, progress=True)

ViT

flowvision.models.vit_base_patch16_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Base-patch16-224 model.

Note

ViT-Base-patch16-224 model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_base_patch16_224 = flowvision.models.vit_base_patch16_224(pretrained=False, progress=True)
flowvision.models.vit_base_patch16_224_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Base-patch16-224 ImageNet21k pretrained model.

Note

ViT-Base-patch16-224 ImageNet21k pretrained model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_base_patch16_224_in21k = flowvision.models.vit_base_patch16_224_in21k(pretrained=False, progress=True)
flowvision.models.vit_base_patch16_224_miil(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Base-patch16-224-miil model.

Note

ViT-Base-patch16-224-miil model from “Training data-efficient image transformers & distillation through attention”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_base_patch16_224_miil = flowvision.models.vit_base_patch16_224_miil(pretrained=False, progress=True)
flowvision.models.vit_base_patch16_224_miil_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Base-patch16-224-miil ImageNet21k pretrained model.

Note

ViT-Base-patch16-224-miil ImageNet21k pretrained model from “Training data-efficient image transformers & distillation through attention”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_base_patch16_224_miil_in21k = flowvision.models.vit_base_patch16_224_miil_in21k(pretrained=False, progress=True)
flowvision.models.vit_base_patch16_224_sam(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Base-patch16-224-sam model.

Note

ViT-Base-patch16-224-sam model from “When Vision Transformers Outperform ResNets without Pre-training or Strong Data Augmentations”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_base_patch16_224_sam = flowvision.models.vit_base_patch16_224_sam(pretrained=False, progress=True)
flowvision.models.vit_base_patch16_384(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Base-patch16-384 model.

Note

ViT-Base-patch16-384 model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_base_patch16_384 = flowvision.models.vit_base_patch16_384(pretrained=False, progress=True)
flowvision.models.vit_base_patch32_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Base-patch32-224 model.

Note

ViT-Base-patch32-224 model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_base_patch32_224 = flowvision.models.vit_base_patch32_224(pretrained=False, progress=True)
flowvision.models.vit_base_patch32_224_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Base-patch32-224 ImageNet21k pretrained model.

Note

ViT-Base-patch32-224 ImageNet21k pretrained model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_base_patch32_224_in21k = flowvision.models.vit_base_patch32_224_in21k(pretrained=False, progress=True)
flowvision.models.vit_base_patch32_224_sam(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Base-patch32-224-sam model.

Note

ViT-Base-patch32-224-sam model from “When Vision Transformers Outperform ResNets without Pre-training or Strong Data Augmentations”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_base_patch32_224_sam = flowvision.models.vit_base_patch32_224_sam(pretrained=False, progress=True)
flowvision.models.vit_base_patch32_384(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Base-patch32-384 model.

Note

ViT-Base-patch32-384 model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_base_patch32_384 = flowvision.models.vit_base_patch32_384(pretrained=False, progress=True)
flowvision.models.vit_base_patch8_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Base-patch8-224 model.

Note

ViT-Base-patch8-224 model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_base_patch8_224 = flowvision.models.vit_base_patch8_224(pretrained=False, progress=True)
flowvision.models.vit_base_patch8_224_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Base-patch8-224 ImageNet21k pretrained model.

Note

ViT-Base-patch8-224 ImageNet21k pretrained model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_base_patch8_224_in21k = flowvision.models.vit_base_patch8_224_in21k(pretrained=False, progress=True)
flowvision.models.vit_giant_patch14_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Giant-patch14-224 model.

Note

ViT-Giant-patch14-224 model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_giant_patch14_224 = flowvision.models.vit_giant_patch14_224(pretrained=False, progress=True)
flowvision.models.vit_gigantic_patch14_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Gigantic-patch14-224 model.

Note

ViT-Giant-patch14-224 model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_gigantic_patch14_224 = flowvision.models.vit_gigantic_patch14_224(pretrained=False, progress=True)
flowvision.models.vit_huge_patch14_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Huge-patch14-224 model.

Note

ViT-Huge-patch14-224 model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_huge_patch14_224 = flowvision.models.vit_huge_patch14_224(pretrained=False, progress=True)
flowvision.models.vit_huge_patch14_224_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Huge-patch14-224 ImageNet21k pretrained model.

Note

ViT-Huge-patch14-224 ImageNet21k pretrained model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_huge_patch14_224_in21k = flowvision.models.vit_huge_patch14_224_in21k(pretrained=False, progress=True)
flowvision.models.vit_large_patch16_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Large-patch16-224 model.

Note

ViT-Large-patch16-224 model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_large_patch16_224 = flowvision.models.vit_large_patch16_224(pretrained=False, progress=True)
flowvision.models.vit_large_patch16_224_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Large-patch16-224 ImageNet21k pretrained model.

Note

ViT-Large-patch16-224 ImageNet21k pretrained model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_large_patch16_224_in21k = flowvision.models.vit_large_patch16_224_in21k(pretrained=False, progress=True)
flowvision.models.vit_large_patch16_384(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Large-patch16-384 model.

Note

ViT-Large-patch16-384 model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_large_patch16_384 = flowvision.models.vit_large_patch16_384(pretrained=False, progress=True)
flowvision.models.vit_large_patch32_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Large-patch32-224 model.

Note

ViT-Large-patch32-224 model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_large_patch32_224 = flowvision.models.vit_large_patch32_224(pretrained=False, progress=True)
flowvision.models.vit_large_patch32_224_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Large-patch32-224 ImageNet21k pretrained model.

Note

ViT-Large-patch32-224 ImageNet21k pretrained model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_large_patch32_224_in21k = flowvision.models.vit_large_patch32_224_in21k(pretrained=False, progress=True)
flowvision.models.vit_large_patch32_384(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Large-patch32-384 model.

Note

ViT-Large-patch32-384 model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_large_patch32_384 = flowvision.models.vit_large_patch32_384(pretrained=False, progress=True)
flowvision.models.vit_small_patch16_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Small-patch16-224 model.

Note

ViT-Small-patch16-224 model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_small_patch16_224 = flowvision.models.vit_small_patch16_224(pretrained=False, progress=True)
flowvision.models.vit_small_patch16_224_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Small-patch16-224 ImageNet21k pretrained model.

Note

ViT-Small-patch16-224 ImageNet21k pretrained model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_small_patch16_224_in21k = flowvision.models.vit_small_patch16_224_in21k(pretrained=False, progress=True)
flowvision.models.vit_small_patch16_384(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Small-patch16-384 model.

Note

ViT-Small-patch16-384 model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_small_patch16_384 = flowvision.models.vit_small_patch16_384(pretrained=False, progress=True)
flowvision.models.vit_small_patch32_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Small-patch32-224 model.

Note

ViT-Small-patch32-224 model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_small_patch32_224 = flowvision.models.vit_small_patch32_224(pretrained=False, progress=True)
flowvision.models.vit_small_patch32_224_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Small-patch32-224 ImageNet21k pretrained model.

Note

ViT-Small-patch32-224 ImageNet21k pretrained model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_small_patch32_224_in21k = flowvision.models.vit_small_patch32_224_in21k(pretrained=False, progress=True)
flowvision.models.vit_small_patch32_384(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Small-patch32-384 model.

Note

ViT-Small-patch32-384 model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_small_patch32_384 = flowvision.models.vit_small_patch32_384(pretrained=False, progress=True)
flowvision.models.vit_tiny_patch16_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Tiny-patch16-224 model.

Note

ViT-Tiny-patch16-224 model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_tiny_patch16_224 = flowvision.models.vit_tiny_patch16_224(pretrained=False, progress=True)
flowvision.models.vit_tiny_patch16_224_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Tiny-patch16-224 ImageNet21k pretrained model.

Note

ViT-Tiny-patch16-224 ImageNet21k pretrained model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_tiny_patch16_224_in21k = flowvision.models.vit_tiny_patch16_224_in21k(pretrained=False, progress=True)
flowvision.models.vit_tiny_patch16_384(pretrained=False, progress=True, **kwargs)[source]

Constructs the ViT-Tiny-patch16-384 model.

Note

ViT-Tiny-patch16-384 model from “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> vit_tiny_patch16_384 = flowvision.models.vit_tiny_patch16_384(pretrained=False, progress=True)

DeiT

flowvision.models.deit_base_distilled_patch16_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Base-patch16-224 distilled model.

Note

DeiT-Base-patch16-224 distilled model from “Training data-efficient image transformers & distillation through attention”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_base_distilled_patch16_224 = flowvision.models.deit_base_distilled_patch16_224(pretrained=False, progress=True)
flowvision.models.deit_base_distilled_patch16_384(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Base-patch16-384 distilled model.

Note

DeiT-Base-patch16-384 distilled model from “Training data-efficient image transformers & distillation through attention”. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_base_distilled_patch16_384 = flowvision.models.deit_base_distilled_patch16_384(pretrained=False, progress=True)
flowvision.models.deit_base_patch16_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Base-patch16-224 model.

Note

DeiT-Base-patch16-224 model from “Training data-efficient image transformers & distillation through attention”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_base_patch16_224 = flowvision.models.deit_base_patch16_224(pretrained=False, progress=True)
flowvision.models.deit_base_patch16_384(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Base-patch16-384 model.

Note

DeiT-Base-patch16-384 model from “Training data-efficient image transformers & distillation through attention”. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_base_patch16_384 = flowvision.models.deit_base_patch16_384(pretrained=False, progress=True)
flowvision.models.deit_small_distilled_patch16_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Small-patch16-224 distilled model.

Note

DeiT-Small-patch16-224 distilled model from “Training data-efficient image transformers & distillation through attention”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_small_distilled_patch16_224 = flowvision.models.deit_small_distilled_patch16_224(pretrained=False, progress=True)
flowvision.models.deit_small_patch16_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Small-patch16-224 model.

Note

DeiT-Small-patch16-224 model from “Training data-efficient image transformers & distillation through attention”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_small_patch16_224 = flowvision.models.deit_small_patch16_224(pretrained=False, progress=True)
flowvision.models.deit_tiny_distilled_patch16_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Tiny-patch16-224 distilled model.

Note

DeiT-Tiny-patch16-224 distilled model from “Training data-efficient image transformers & distillation through attention”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_tiny_distilled_patch16_224 = flowvision.models.deit_tiny_distilled_patch16_224(pretrained=False, progress=True)
flowvision.models.deit_tiny_patch16_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Tiny-patch16-224 model.

Note

DeiT-Tiny-patch16-224 model from “Training data-efficient image transformers & distillation through attention”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_tiny_patch16_224 = flowvision.models.deit_tiny_patch16_224(pretrained=False, progress=True)

PVT

flowvision.models.pvt_large(pretrained=False, progress=True, **kwargs)[source]

Constructs the PVT-large model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> pvt_large = flowvision.models.pvt_large(pretrained=False, progress=True)
flowvision.models.pvt_medium(pretrained=False, progress=True, **kwargs)[source]

Constructs the PVT-medium model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> pvt_medium = flowvision.models.pvt_medium(pretrained=False, progress=True)
flowvision.models.pvt_small(pretrained=False, progress=True, **kwargs)[source]

Constructs the PVT-small model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> pvt_small = flowvision.models.pvt_small(pretrained=False, progress=True)
flowvision.models.pvt_tiny(pretrained=False, progress=True, **kwargs)[source]

Constructs the PVT-tiny model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> pvt_tiny = flowvision.models.pvt_tiny(pretrained=False, progress=True)

Swin-Transformer

flowvision.models.swin_base_patch4_window12_384(pretrained=False, progress=True, **kwargs)[source]

Constructs Swin-B 384x384 model trained on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> swin_base_patch4_window12_384 = flowvision.models.swin_base_patch4_window12_384(pretrained=False, progress=True)
flowvision.models.swin_base_patch4_window12_384_in22k_to_1k(pretrained=False, progress=True, **kwargs)[source]

Constructs Swin-B 384x384 model pretrained on ImageNet-22k and fine tuned on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> swin_base_patch4_window12_384_in22k_to_1k = flowvision.models.swin_base_patch4_window12_384_in22k_to_1k(pretrained=False, progress=True)
flowvision.models.swin_base_patch4_window7_224(pretrained=False, progress=True, **kwargs)[source]

Constructs Swin-B 224x224 model trained on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> swin_base_patch4_window7_224 = flowvision.models.swin_base_patch4_window7_224(pretrained=False, progress=True)
flowvision.models.swin_base_patch4_window7_224_in22k_to_1k(pretrained=False, progress=True, **kwargs)[source]

Constructs Swin-B 224x224 model pretrained on ImageNet-22k and fine tuned on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> swin_base_patch4_window7_224_in22k_to_1k = flowvision.models.swin_base_patch4_window7_224_in22k_to_1k(pretrained=False, progress=True)
flowvision.models.swin_large_patch4_window12_384_in22k_to_1k(pretrained=False, progress=True, **kwargs)[source]

Constructs Swin-L 384x384 model pretrained on ImageNet-22k and fine tuned on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> swin_large_patch4_window12_384_in22k_to_1k = flowvision.models.swin_large_patch4_window12_384_in22k_to_1k(pretrained=False, progress=True)
flowvision.models.swin_large_patch4_window7_224_in22k_to_1k(pretrained=False, progress=True, **kwargs)[source]

Constructs Swin-L 224x224 model pretrained on ImageNet-22k and fine tuned on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> swin_large_patch4_window7_224_in22k_to_1k = flowvision.models.swin_large_patch4_window7_224_in22k_to_1k(pretrained=False, progress=True)
flowvision.models.swin_small_patch4_window7_224(pretrained=False, progress=True, **kwargs)[source]

Constructs Swin-S 224x224 model trained on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> swin_small_patch4_window7_224 = flowvision.models.swin_small_patch4_window7_224(pretrained=False, progress=True)
flowvision.models.swin_tiny_patch4_window7_224(pretrained=False, progress=True, **kwargs)[source]

Constructs Swin-T 224x224 model trained on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> swin_tiny_patch4_window7_224 = flowvision.models.swin_tiny_patch4_window7_224(pretrained=False, progress=True)

CSwin-Transformer

flowvision.models.cswin_base_224(pretrained=False, progress=True, **kwargs)[source]

Constructs CSwin-B 224x224 model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> cswin_base_224 = flowvision.models.cswin_base_224(pretrained=False, progress=True)
flowvision.models.cswin_base_384(pretrained=False, progress=True, **kwargs)[source]

Constructs CSwin-B 384x384 model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> cswin_base_384 = flowvision.models.cswin_base_384(pretrained=False, progress=True)
flowvision.models.cswin_large_224(pretrained=False, progress=True, **kwargs)[source]

Constructs CSwin-L 224x224 model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> cswin_large_224 = flowvision.models.cswin_large_224(pretrained=False, progress=True)
flowvision.models.cswin_large_384(pretrained=False, progress=True, **kwargs)[source]

Constructs CSwin-L 384x384 model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> cswin_large_384 = flowvision.models.cswin_large_384(pretrained=False, progress=True)
flowvision.models.cswin_small_224(pretrained=False, progress=True, **kwargs)[source]

Constructs CSwin-S 224x224 model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> cswin_small_224 = flowvision.models.cswin_small_224(pretrained=False, progress=True)
flowvision.models.cswin_tiny_224(pretrained=False, progress=True, **kwargs)[source]

Constructs CSwin-T 224x224 model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> cswin_tiny_224 = flowvision.models.cswin_tiny_224(pretrained=False, progress=True)

CrossFormer

flowvision.models.crossformer_base_patch4_group7_224(pretrained=False, progress=True, **kwargs)[source]

Constructs CrossFormer-B 224x224 model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> crossformer_base_patch4_group7_224 = flowvision.models.crossformer_base_patch4_group7_224(pretrained=False, progress=True)
flowvision.models.crossformer_large_patch4_group7_224(pretrained=False, progress=True, **kwargs)[source]

Constructs CrossFormer-L 224x224 model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> crossformer_large_patch4_group7_224 = flowvision.models.crossformer_large_patch4_group7_224(pretrained=False, progress=True)
flowvision.models.crossformer_small_patch4_group7_224(pretrained=False, progress=True, **kwargs)[source]

Constructs CrossFormer-S 224x224 model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> crossformer_small_patch4_group7_224 = flowvision.models.crossformer_small_patch4_group7_224(pretrained=False, progress=True)
flowvision.models.crossformer_tiny_patch4_group7_224(pretrained=False, progress=True, **kwargs)[source]

Constructs CrossFormer-T 224x224 model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> crossformer_tiny_patch4_group7_224 = flowvision.models.crossformer_tiny_patch4_group7_224(pretrained=False, progress=True)

PoolFormer

flowvision.models.poolformer_m36(pretrained=False, progress=True, **kwargs)[source]

Constructs the PoolFormer-M36 model.

Note

PoolFormer-M36 model. From “MetaFormer is Actually What You Need for Vision” <https://arxiv.org/abs/2111.11418> _.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> poolformer_m36 = flowvision.models.poolformer_m36(pretrained=False, progress=True)
flowvision.models.poolformer_m48(pretrained=False, progress=True, **kwargs)[source]

Constructs the PoolFormer-M48 model.

Note

PoolFormer-M48 model. From “MetaFormer is Actually What You Need for Vision” <https://arxiv.org/abs/2111.11418> _.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> poolformer_m48 = flowvision.models.poolformer_m48(pretrained=False, progress=True)
flowvision.models.poolformer_s12(pretrained=False, progress=True, **kwargs)[source]

Constructs the PoolFormer-S12 model.

Note

PoolFormer-S12 model. From “MetaFormer is Actually What You Need for Vision” <https://arxiv.org/abs/2111.11418> _.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> poolformer_s12 = flowvision.models.poolformer_s12(pretrained=False, progress=True)
flowvision.models.poolformer_s24(pretrained=False, progress=True, **kwargs)[source]

Constructs the PoolFormer-S24 model.

Note

PoolFormer-S24 model. From “MetaFormer is Actually What You Need for Vision” <https://arxiv.org/abs/2111.11418> _.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> poolformer_s24 = flowvision.models.poolformer_s24(pretrained=False, progress=True)
flowvision.models.poolformer_s36(pretrained=False, progress=True, **kwargs)[source]

Constructs the PoolFormer-S36 model.

Note

PoolFormer-S36 model. From “MetaFormer is Actually What You Need for Vision” <https://arxiv.org/abs/2111.11418> _.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> poolformer_s36 = flowvision.models.poolformer_s36(pretrained=False, progress=True)

UniFormer

flowvision.models.uniformer_base(pretrained=False, progress=True, **kwargs)[source]

Constructs the UniFormer-Base model.

Note

UniFormer-Base model from UniFormer: Unified Transformer for Efficient Spatiotemporal Representation Learning -

https://arxiv.org/abs/2201.04676

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> uniformer_base= flowvision.models.uniformer_base(pretrained=False, progress=True)
flowvision.models.uniformer_base_ls(pretrained=False, progress=True, **kwargs)[source]

Constructs the UniFormer-Base-Ls model.

Note

UniFormer-Base-Ls model from UniFormer: Unified Transformer for Efficient Spatiotemporal Representation Learning -

https://arxiv.org/abs/2201.04676

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> uniformer_base_ls = flowvision.models.uniformer_base_ls(pretrained=False, progress=True)
flowvision.models.uniformer_small(pretrained=False, progress=True, **kwargs)[source]

Constructs the UniFormer-Small model.

Note

UniFormer-Small model from UniFormer: Unified Transformer for Efficient Spatiotemporal Representation Learning -

https://arxiv.org/abs/2201.04676

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> uniformer_small = flowvision.models.uniformer_small(pretrained=False, progress=True)
flowvision.models.uniformer_small_plus(pretrained=False, progress=True, **kwargs)[source]

Constructs the UniFormer-Small-Plus model.

Note

UniFormer-Small-Plus model from UniFormer: Unified Transformer for Efficient Spatiotemporal Representation Learning -

https://arxiv.org/abs/2201.04676

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> uniformer_small_plus = flowvision.models.uniformer_small_plus(pretrained=False, progress=True)

Mlp-Mixer

flowvision.models.mlp_mixer_b16_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the Mixer-B/16 224x224 model.

Note

Mixer-B/16 224x224 model from “MLP-Mixer: An all-MLP Architecture for Vision”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mlp_mixer_b16_224 = flowvision.models.mlp_mixer_b16_224(pretrained=False, progress=True)
flowvision.models.mlp_mixer_b16_224_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the Mixer-B/16 224x224 ImageNet21k pretrained model.

Note

Mixer-B/16 224x224 ImageNet21k pretrained model from “MLP-Mixer: An all-MLP Architecture for Vision”. Note that this model is the pretrained model for fine-tune on different datasets.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mlp_mixer_b16_224_in21k = flowvision.models.mlp_mixer_b16_224_in21k(pretrained=False, progress=True)
flowvision.models.mlp_mixer_b16_224_miil(pretrained=False, progress=True, **kwargs)[source]

Constructs the Mixer-B/16 224x224 model with different weights.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mlp_mixer_b16_224_miil = flowvision.models.mlp_mixer_b16_224_miil(pretrained=False, progress=True)
flowvision.models.mlp_mixer_b16_224_miil_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the Mixer-B/16 224x224 ImageNet21k pretrained model.

Note

Mixer-B/16 224x224 ImageNet21k pretrained model from “MLP-Mixer: An all-MLP Architecture for Vision”. Weights taken from: https://github.com/Alibaba-MIIL/ImageNet21K

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mlp_mixer_b16_224_miil_in21k = flowvision.models.mlp_mixer_b16_224_miil_in21k(pretrained=False, progress=True)
flowvision.models.mlp_mixer_b32_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the Mixer-B/32 224x224 model.

Note

Mixer-B/32 224x224 model from “MLP-Mixer: An all-MLP Architecture for Vision”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mlp_mixer_b32_224 = flowvision.models.mlp_mixer_b32_224(pretrained=False, progress=True)
flowvision.models.mlp_mixer_l16_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the Mixer-L/16 224x224 model.

Note

Mixer-L/16 224x224 model from “MLP-Mixer: An all-MLP Architecture for Vision”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mlp_mixer_l16_224 = flowvision.models.mlp_mixer_l16_224(pretrained=False, progress=True)
flowvision.models.mlp_mixer_l16_224_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the Mixer-L/16 224x224 ImageNet21k pretrained model.

Note

Mixer-L/16 224x224 ImageNet21k pretrained model from “MLP-Mixer: An all-MLP Architecture for Vision”. Note that this model is the pretrained model for fine-tune on different datasets.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mlp_mixer_l16_224_in21k = flowvision.models.mlp_mixer_l16_224_in21k(pretrained=False, progress=True)
flowvision.models.mlp_mixer_l32_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the Mixer-L/32 224x224 model.

Note

Mixer-L/32 224x224 model from “MLP-Mixer: An all-MLP Architecture for Vision”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mlp_mixer_l32_224 = flowvision.models.mlp_mixer_l32_224(pretrained=False, progress=True)
flowvision.models.mlp_mixer_s16_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the Mixer-S/16 224x224 model.

Note

Mixer-S/16 224x224 model from “MLP-Mixer: An all-MLP Architecture for Vision”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mlp_mixer_s16_224 = flowvision.models.mlp_mixer_s16_224(pretrained=False, progress=True)
flowvision.models.mlp_mixer_s32_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the Mixer-S/32 224x224 model.

Note

Mixer-S/32 224x224 model from “MLP-Mixer: An all-MLP Architecture for Vision”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mlp_mixer_s32_224 = flowvision.models.mlp_mixer_s32_224(pretrained=False, progress=True)

ResMLP

flowvision.models.resmlp_12_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ResMLP-12 model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resmlp_12_224 = flowvision.models.resmlp_12_224(pretrained=False, progress=True)
flowvision.models.resmlp_12_224_dino(pretrained=False, progress=True, **kwargs)[source]

Constructs the ResMLP-12 model trained under DINO proposed in “Emerging Properties in Self-Supervised Vision Transformers”.

Note

ResMLP-12 model with distillation from “ResMLP: Feedforward networks for image classification with data-efficient training”. Note that this model is the same as resmlp_12 but the pretrained weight is different.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resmlp_12_224_dino = flowvision.models.resmlp_12_224_dino(pretrained=False, progress=True)
flowvision.models.resmlp_12_distilled_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ResMLP-12 model with distillation.

Note

ResMLP-12 model with distillation from “ResMLP: Feedforward networks for image classification with data-efficient training”. Note that this model is the same as resmlp_12 but the pretrained weight is different.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resmlp_12_distilled_224 = flowvision.models.resmlp_12_distilled_224(pretrained=False, progress=True)
flowvision.models.resmlp_24_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ResMLP-24 model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resmlp_24_224 = flowvision.models.resmlp_24_224(pretrained=False, progress=True)
flowvision.models.resmlp_24_224_dino(pretrained=False, progress=True, **kwargs)[source]

Constructs the ResMLP-24 model trained under DINO proposed in “Emerging Properties in Self-Supervised Vision Transformers”.

Note

ResMLP-24 model with distillation from “ResMLP: Feedforward networks for image classification with data-efficient training”. Note that this model is the same as resmlp_24 but the pretrained weight is different.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resmlp_24_224_dino = flowvision.models.resmlp_24_224_dino(pretrained=False, progress=True)
flowvision.models.resmlp_24_distilled_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ResMLP-24 model with distillation.

Note

ResMLP-24 model with distillation from “ResMLP: Feedforward networks for image classification with data-efficient training”. Note that this model is the same as resmlp_24 but the pretrained weight is different.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resmlp_24_distilled_224 = flowvision.models.resmlp_24_distilled_224(pretrained=False, progress=True)
flowvision.models.resmlp_36_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ResMLP-36 model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resmlp_36_224 = flowvision.models.resmlp_36_224(pretrained=False, progress=True)
flowvision.models.resmlp_36_distilled_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ResMLP-36 model with distillation.

Note

ResMLP-36 model with distillation from “ResMLP: Feedforward networks for image classification with data-efficient training”. Note that this model is the same as resmlp_36 but the pretrained weight is different.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resmlp_36_distilled_224 = flowvision.models.resmlp_36_distilled_224(pretrained=False, progress=True)
flowvision.models.resmlp_big_24_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ResMLP-Big-24 model.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resmlp_big_24_224 = flowvision.models.resmlp_big_24_224(pretrained=False, progress=True)
flowvision.models.resmlp_big_24_224_in22k_to_1k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ImageNet22k pretrained ResMLP-B-24 model.

Note

ImageNet22k pretrained ResMLP-B-24 model from “ResMLP: Feedforward networks for image classification with data-efficient training”. Note that this model is the same as resmlpB_24 but the pretrained weight is different.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resmlp_big_24_224_in22k_to_1k = flowvision.models.resmlp_big_24_224_in22k_to_1k(pretrained=False, progress=True)
flowvision.models.resmlp_big_24_distilled_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ResMLP-B-24 model with distillation.

Note

ResMLP-B-24 model with distillation from “ResMLP: Feedforward networks for image classification with data-efficient training”. Note that this model is the same as resmlpB_24 but the pretrained weight is different.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> resmlp_big_24_distilled_224 = flowvision.models.resmlp_big_24_distilled_224(pretrained=False, progress=True)

gMLP

flowvision.models.gmlp_b16_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the gMLP-base-16 224x224 model.

Note

gMLP-base-16 224x224 model from “Pay Attention to MLPs”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> gmlp_b16_224 = flowvision.models.gmlp_b16_224(pretrained=False, progress=True)
flowvision.models.gmlp_s16_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the gMLP-small-16 224x224 model.

Note

gMLP-small-16 224x224 model from “Pay Attention to MLPs”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> gmlp_s16_224 = flowvision.models.gmlp_s16_224(pretrained=False, progress=True)
flowvision.models.gmlp_ti16_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the gMLP-tiny-16 224x224 model.

Note

gMLP-tiny-16 224x224 model from “Pay Attention to MLPs”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> gmlp_ti16_224 = flowvision.models.gmlp_ti16_224(pretrained=False, progress=True)

ConvMixer

flowvision.models.convmixer_1024_20(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs the ConvMixer model with 20 depth and 1024 hidden size.

Note

ConvMixer model with 20 depth and 1024 hidden size from the Patched Are All You Need? paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> convmixer_1024_20 = flowvision.models.convmixer_1024_20(pretrained=False, progress=True)
flowvision.models.convmixer_1536_20(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs the ConvMixer model with 20 depth and 1536 hidden size.

Note

ConvMixer model with 20 depth and 1536 hidden size from the Patched Are All You Need? paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> convmixer_1536_20 = flowvision.models.convmixer_1536_20(pretrained=False, progress=True)
flowvision.models.convmixer_768_32_relu(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs the ConvMixer model with 32 depth and 768 hidden size and ReLU activation layer.

Note

ConvMixer model with 32 depth and 768 hidden size and ReLU activation layer from the Patched Are All You Need? paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> convmixer_768_32_relu = flowvision.models.convmixer_768_32_relu(pretrained=False, progress=True)

ConvNeXt

flowvision.models.convnext_base_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ConvNext-Base model trained on ImageNet2012.

Note

ConvNext-Base model from “A ConvNet for the 2020s” <https://arxiv.org/abs/2201.03545> _. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> convnext_base_224 = flowvision.models.convnext_base_224(pretrained=False, progress=True)
flowvision.models.convnext_base_224_22k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ConvNext-Base model pretrained on ImageNet22k.

Note

ConvNext-Base model from “A ConvNet for the 2020s” <https://arxiv.org/abs/2201.03545> _. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> convnext_base_224_22k = flowvision.models.convnext_base_224_22k(pretrained=False, progress=True)
flowvision.models.convnext_base_224_22k_to_1k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ConvNext-Base model pretrained on ImageNet22k and finetuned on ImageNet2012.

Note

ConvNext-Base model from “A ConvNet for the 2020s” <https://arxiv.org/abs/2201.03545> _. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> convnext_base_224_22k_to_1k = flowvision.models.convnext_base_224_22k_to_1k(pretrained=False, progress=True)
flowvision.models.convnext_base_384(pretrained=False, progress=True, **kwargs)[source]

Constructs the ConvNext-Base model trained on ImageNet2012.

Note

ConvNext-Base model from “A ConvNet for the 2020s” <https://arxiv.org/abs/2201.03545> _. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> convnext_base_384 = flowvision.models.convnext_base_384(pretrained=False, progress=True)
flowvision.models.convnext_base_384_22k_to_1k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ConvNext-Base model pretrained on ImageNet22k and finetuned on ImageNet2012.

Note

ConvNext-Base model from “A ConvNet for the 2020s” <https://arxiv.org/abs/2201.03545> _. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> convnext_base_384_22k_to_1k = flowvision.models.convnext_base_384_22k_to_1k(pretrained=False, progress=True)
flowvision.models.convnext_iso_base_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ConvNext-Isotropic-Base model trained on ImageNet2012.

Note

ConvNext-Isotropic-Base model from “A ConvNet for the 2020s” <https://arxiv.org/abs/2201.03545> _. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> convnext_iso_base_224 = flowvision.models.convnext_iso_base_224(pretrained=False, progress=True)
flowvision.models.convnext_iso_large_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ConvNext-Isotropic-Large model trained on ImageNet2012.

Note

ConvNext-Isotropic-Large model from “A ConvNet for the 2020s” <https://arxiv.org/abs/2201.03545> _. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> convnext_iso_large_224 = flowvision.models.convnext_iso_large_224(pretrained=False, progress=True)
flowvision.models.convnext_iso_small_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ConvNext-Isotropic-Small model trained on ImageNet2012.

Note

ConvNext-Isotropic-Small model from “A ConvNet for the 2020s” <https://arxiv.org/abs/2201.03545> _. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> convnext_iso_small_224 = flowvision.models.convnext_iso_small_224(pretrained=False, progress=True)
flowvision.models.convnext_large_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ConvNext-Large model trained on ImageNet2012.

Note

ConvNext-Large model from “A ConvNet for the 2020s” <https://arxiv.org/abs/2201.03545> _. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> convnext_large_224 = flowvision.models.convnext_large_224(pretrained=False, progress=True)
flowvision.models.convnext_large_224_22k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ConvNext-Large model trained on ImageNet22k.

Note

ConvNext-Large model from “A ConvNet for the 2020s” <https://arxiv.org/abs/2201.03545> _. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> convnext_large_224_22k = flowvision.models.convnext_large_224_22k(pretrained=False, progress=True)
flowvision.models.convnext_large_224_22k_to_1k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ConvNext-Large model pretrained on ImageNet22k and finetuned on ImageNet2012.

Note

ConvNext-Large model from “A ConvNet for the 2020s” <https://arxiv.org/abs/2201.03545> _. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> convnext_large_224_22k_to_1k = flowvision.models.convnext_large_224_22k_to_1k(pretrained=False, progress=True)
flowvision.models.convnext_large_384(pretrained=False, progress=True, **kwargs)[source]

Constructs the ConvNext-Large model trained on ImageNet2012.

Note

ConvNext-Large model from “A ConvNet for the 2020s” <https://arxiv.org/abs/2201.03545> _. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> convnext_large_384 = flowvision.models.convnext_large_384(pretrained=False, progress=True)
flowvision.models.convnext_large_384_22k_to_1k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ConvNext-Large model pretrained on ImageNet22k and finetuned on ImageNet2012.

Note

ConvNext-Large model from “A ConvNet for the 2020s” <https://arxiv.org/abs/2201.03545> _. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> convnext_large_384_22k_to_1k = flowvision.models.convnext_large_384_22k_to_1k(pretrained=False, progress=True)
flowvision.models.convnext_small_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ConvNext-Small model trained on ImageNet2012.

Note

ConvNext-Small model from “A ConvNet for the 2020s” <https://arxiv.org/abs/2201.03545> _. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> convnext_small_224 = flowvision.models.convnext_small_224(pretrained=False, progress=True)
flowvision.models.convnext_tiny_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the ConvNext-Tiny model trained on ImageNet2012.

Note

ConvNext-Tiny model from “A ConvNet for the 2020s” <https://arxiv.org/abs/2201.03545> _. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> convnext_tiny_224 = flowvision.models.convnext_tiny_224(pretrained=False, progress=True)
flowvision.models.convnext_xlarge_224_22k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ConvNext-xLarge model pretrained on ImageNet22k.

Note

ConvNext-xLarge model from “A ConvNet for the 2020s” <https://arxiv.org/abs/2201.03545> _. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> convnext_xlarge_224_22k = flowvision.models.convnext_xlarge_224_22k(pretrained=False, progress=True)
flowvision.models.convnext_xlarge_224_22k_to_1k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ConvNext-xLarge model pretrained on ImageNet22k and finetuned on ImageNet2012.

Note

ConvNext-xLarge model from “A ConvNet for the 2020s” <https://arxiv.org/abs/2201.03545> _. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> convnext_xlarge_224_22k_to_1k = flowvision.models.convnext_xlarge_224_22k_to_1k(pretrained=False, progress=True)
flowvision.models.convnext_xlarge_384_22k_to_1k(pretrained=False, progress=True, **kwargs)[source]

Constructs the ConvNext-xLarge model pretrained on ImageNet22k and finetuned on ImageNet2012.

Note

ConvNext-xLarge model from “A ConvNet for the 2020s” <https://arxiv.org/abs/2201.03545> _. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderrt. Default: True

For example:

>>> import flowvision
>>> convnext_xlarge_384_22k_to_1k = flowvision.models.convnext_xlarge_384_22k_to_1k(pretrained=False, progress=True)

RegionViT

flowvision.models.regionvit_base_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the RegionViT-Base-224 model.

Note

RegionViT-Base-224 model from “RegionViT: Regional-to-Local Attention for Vision Transformers”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regionvit_base_224 = flowvision.models.regionvit_base_224(pretrained=False, progress=True)
flowvision.models.regionvit_base_w14_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the RegionViT-Base-w14-224 model.

Note

RegionViT-Base-w14-224 model from “RegionViT: Regional-to-Local Attention for Vision Transformers”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regionvit_base_w14_224 = flowvision.models.regionvit_base_w14_224(pretrained=False, progress=True)
flowvision.models.regionvit_base_w14_peg_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the RegionViT-Base-w14-peg-224 model.

Note

RegionViT-Base-w14-peg-224 model from “RegionViT: Regional-to-Local Attention for Vision Transformers”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regionvit_base_w14_peg_224 = flowvision.models.regionvit_base_w14_peg_224(pretrained=False, progress=True)
flowvision.models.regionvit_medium_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the RegionViT-Medium-224 model.

Note

RegionViT-Medium-224 model from “RegionViT: Regional-to-Local Attention for Vision Transformers”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regionvit_medium_224 = flowvision.models.regionvit_medium_224(pretrained=False, progress=True)
flowvision.models.regionvit_small_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the RegionViT-Small-224 model.

Note

RegionViT-Small-224 model from “RegionViT: Regional-to-Local Attention for Vision Transformers”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regionvit_small_224 = flowvision.models.regionvit_small_224(pretrained=False, progress=True)
flowvision.models.regionvit_small_w14_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the RegionViT-Small-w14-224 model.

Note

RegionViT-Small-w14-224 model from “RegionViT: Regional-to-Local Attention for Vision Transformers”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regionvit_small_w14_224 = flowvision.models.regionvit_small_w14_224(pretrained=False, progress=True)
flowvision.models.regionvit_small_w14_peg_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the RegionViT-Small-w14-peg-224 model.

Note

RegionViT-Small-w14-peg-224 model from “RegionViT: Regional-to-Local Attention for Vision Transformers”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regionvit_small_w14_peg_224 = flowvision.models.regionvit_small_w14_peg_224(pretrained=False, progress=True)
flowvision.models.regionvit_tiny_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the RegionViT-Tiny-224 model.

Note

RegionViT-Tiny-224 model from “RegionViT: Regional-to-Local Attention for Vision Transformers”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> regionvit_tiny_224 = flowvision.models.regionvit_tiny_224(pretrained=False, progress=True)

VAN

flowvision.models.van_base(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs the VAN-Base model trained on ImageNet-1k.

Note

VAN-Base model from “Visual Attention Network”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> van_base = flowvision.models.van_base(pretrained=False, progress=True)
flowvision.models.van_large(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs the VAN-Large model trained on ImageNet-1k.

Note

VAN-Large model from “Visual Attention Network”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> van_large = flowvision.models.van_large(pretrained=False, progress=True)
flowvision.models.van_small(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs the VAN-Small model trained on ImageNet-1k.

Note

VAN-Small model from “Visual Attention Network”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> van_small = flowvision.models.van_small(pretrained=False, progress=True)
flowvision.models.van_tiny(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs the VAN-Tiny model trained on ImageNet-1k.

Note

VAN-Tiny model from “Visual Attention Network”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> van_tiny = flowvision.models.van_tiny(pretrained=False, progress=True)

LeViT

flowvision.models.levit_128(num_classes=1000, distillation=True, pretrained=False)[source]

Constructs the LeViT-128 model.

Note

LeViT-128 model architecture from the LeViT: a Vision Transformer in ConvNet’s Clothing for Faster Inference paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> levit_128 = flowvision.models.levit_128(pretrained=False, progress=True)
flowvision.models.levit_128s(num_classes=1000, distillation=True, pretrained=False)[source]

Constructs the LeViT-128S model.

Note

LeViT-128S model architecture from the LeViT: a Vision Transformer in ConvNet’s Clothing for Faster Inference paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> levit_128s = flowvision.models.levit_128s(pretrained=False, progress=True)
flowvision.models.levit_192(num_classes=1000, distillation=True, pretrained=False)[source]

Constructs the LeViT-192 model.

Note

LeViT-192 model architecture from the LeViT: a Vision Transformer in ConvNet’s Clothing for Faster Inference paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> levit_192 = flowvision.models.levit_192(pretrained=False, progress=True)
flowvision.models.levit_256(num_classes=1000, distillation=True, pretrained=False)[source]

Constructs the LeViT-256 model.

Note

LeViT-256 model architecture from the LeViT: a Vision Transformer in ConvNet’s Clothing for Faster Inference paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> levit_256 = flowvision.models.levit_256(pretrained=False, progress=True)
flowvision.models.levit_384(num_classes=1000, distillation=True, pretrained=False)[source]

Constructs the LeViT-384 model.

Note

LeViT-384 model architecture from the LeViT: a Vision Transformer in ConvNet’s Clothing for Faster Inference paper.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> levit_384 = flowvision.models.levit_384(pretrained=False, progress=True)

MobileViT

flowvision.models.mobilevit_small(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs MobileViT-S 224x224 model pretrained on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mobilevit_s = flowvision.models.mobilevit_small(pretrained=False, progress=True)
flowvision.models.mobilevit_x_small(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs MobileViT-XS 224x224 model pretrained on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mobilevit_xs = flowvision.models.mobilevit_x_small(pretrained=False, progress=True)
flowvision.models.mobilevit_xx_small(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs MobileViT-XXS 224x224 model pretrained on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> mobilevit_xxs = flowvision.models.mobilevit_xx_small(pretrained=False, progress=True)

DeiT-III

flowvision.models.deit_base_patch16_LS_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Base-patch16-LS-224 model.

Note

DeiT-Base-patch16-LS-224 model from “DeiT III: Revenge of the ViT”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_base_patch16_LS_224 = flowvision.models.deit_base_patch16_LS_224(pretrained=False, progress=True)
flowvision.models.deit_base_patch16_LS_224_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Base-patch16-LS-224 ImageNet21k pretrained model.

Note

DeiT-Base-patch16-LS-224 ImageNet21k pretrained model from “DeiT III: Revenge of the ViT”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_base_patch16_LS_224_in21k = flowvision.models.deit_base_patch16_LS_224_in21k(pretrained=False, progress=True)
flowvision.models.deit_base_patch16_LS_384(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Base-patch16-LS-384 model.

Note

DeiT-Base-patch16-LS-384 model from “DeiT III: Revenge of the ViT”. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_base_patch16_LS_384 = flowvision.models.deit_base_patch16_LS_384(pretrained=False, progress=True)
flowvision.models.deit_base_patch16_LS_384_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Base-patch16-LS-384 ImageNet21k pretrained model.

Note

DeiT-Base-patch16-LS-384 ImageNet21k pretrained model from “DeiT III: Revenge of the ViT”. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_base_patch16_LS_384_in21k = flowvision.models.deit_base_patch16_LS_384_in21k(pretrained=False, progress=True)
flowvision.models.deit_huge_patch14_LS_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Huge-patch14-LS-224 model.

Note

DeiT-Huge-patch14-LS-224 model from “DeiT III: Revenge of the ViT”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_huge_patch14_LS_224 = flowvision.models.deit_huge_patch14_LS_224(pretrained=False, progress=True)
flowvision.models.deit_huge_patch14_LS_224_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Huge-patch14-LS-224 ImageNet21k pretrained model.

Note

DeiT-Huge-patch14-LS-224 ImageNet21k pretrained model from “DeiT III: Revenge of the ViT”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_huge_patch14_LS_224_in21k = flowvision.models.deit_huge_patch14_LS_224_in21k(pretrained=False, progress=True)
flowvision.models.deit_large_patch16_LS_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Large-patch16-LS-224 model.

Note

DeiT-Large-patch16-LS-224 model from “DeiT III: Revenge of the ViT”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_large_patch16_LS_224 = flowvision.models.deit_large_patch16_LS_224(pretrained=False, progress=True)
flowvision.models.deit_large_patch16_LS_224_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Large-patch16-LS-224 ImageNet21k pretrained model.

Note

DeiT-Large-patch16-LS-224 ImageNet21k pretrained model from “DeiT III: Revenge of the ViT”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_large_patch16_LS_224_in21k = flowvision.models.deit_large_patch16_LS_224_in21k(pretrained=False, progress=True)
flowvision.models.deit_large_patch16_LS_384(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Large-patch16-LS-384 model.

Note

DeiT-Large-patch16-LS-384 model from “DeiT III: Revenge of the ViT”. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_large_patch16_LS_384 = flowvision.models.deit_large_patch16_LS_384(pretrained=False, progress=True)
flowvision.models.deit_large_patch16_LS_384_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Large-patch16-LS-384 ImageNet21k pretrained model.

Note

DeiT-Large-patch16-LS-384 ImageNet21k pretrained model from “DeiT III: Revenge of the ViT”. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_large_patch16_LS_384_in21k = flowvision.models.deit_large_patch16_LS_384_in21k(pretrained=False, progress=True)
flowvision.models.deit_small_patch16_LS_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Small-patch16-LS-224 model.

Note

DeiT-Small-patch16-LS-224 model from “DeiT III: Revenge of the ViT”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_small_patch16_LS_224 = flowvision.models.deit_small_patch16_LS_224(pretrained=False, progress=True)
flowvision.models.deit_small_patch16_LS_224_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Small-patch16-LS-224 ImageNet21k pretrained model.

Note

DeiT-Small-patch16-LS-224 ImageNet21k pretrained model from “DeiT III: Revenge of the ViT”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_small_patch16_LS_224_in21k = flowvision.models.deit_small_patch16_LS_224_in21k(pretrained=False, progress=True)
flowvision.models.deit_small_patch16_LS_384(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Small-patch16-LS-384 model.

Note

DeiT-Small-patch16-LS-384 model from “DeiT III: Revenge of the ViT”. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_small_patch16_LS_384 = flowvision.models.deit_small_patch16_LS_384(pretrained=False, progress=True)
flowvision.models.deit_small_patch16_LS_384_in21k(pretrained=False, progress=True, **kwargs)[source]

Constructs the DeiT-Small-patch16-LS-384 ImageNet21k pretrained model.

Note

DeiT-Small-patch16-LS-384 ImageNet21k pretrained model from “DeiT III: Revenge of the ViT”. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> deit_small_patch16_LS_384_in21k = flowvision.models.deit_small_patch16_LS_384_in21k(pretrained=False, progress=True)

CaiT

flowvision.models.cait_M36_384(pretrained=False, progress=True, **kwargs)[source]

Constructs the CaiT-M36-384 model.

Note

CaiT-M36-384 model from “Going Deeper With Image Transformers”. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> cait_M36_384 = flowvision.models.cait_M36_384(pretrained=False, progress=True)
flowvision.models.cait_M48_448(pretrained=False, progress=True, **kwargs)[source]

Constructs the CaiT-M48-448 model.

Note

CaiT-M48-448 model from “Going Deeper With Image Transformers”. The required input size of the model is 448x448.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> cait_M48_448 = flowvision.models.cait_M48_448(pretrained=False, progress=True)
flowvision.models.cait_S24_224(pretrained=False, progress=True, **kwargs)[source]

Constructs the CaiT-S24-224 model.

Note

CaiT-S24-224 model from “Going Deeper With Image Transformers”. The required input size of the model is 224x224.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> cait_S24_224 = flowvision.models.cait_S24_224(pretrained=False, progress=True)
flowvision.models.cait_S24_384(pretrained=False, progress=True, **kwargs)[source]

Constructs the CaiT-S24-384 model.

Note

CaiT-S24-384 model from “Going Deeper With Image Transformers”. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> cait_S24_384 = flowvision.models.cait_S24_384(pretrained=False, progress=True)
flowvision.models.cait_S36_384(pretrained=False, progress=True, **kwargs)[source]

Constructs the CaiT-S36-384 model.

Note

CaiT-S36-384 model from “Going Deeper With Image Transformers”. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> cait_S36_384 = flowvision.models.cait_S36_384(pretrained=False, progress=True)
flowvision.models.cait_XS24_384(pretrained=False, progress=True, **kwargs)[source]

Constructs the CaiT-XS24-384 model.

Note

CaiT-XS24-384 model from “Going Deeper With Image Transformers”. The required input size of the model is 384x384.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> cait_XS24_384 = flowvision.models.cait_XS24_384(pretrained=False, progress=True)

DLA

flowvision.models.dla102(pretrained=False, progress=True, **kwargs)[source]

Constructs DLA102 224x224 model trained on ImageNet-1k.

Note

DLA102 224x224 model from “Deep Layer Aggregation”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> dla102 = flowvision.models.dla102(pretrained=False, progress=True)
flowvision.models.dla102x(pretrained=False, progress=True, **kwargs)[source]

Constructs DLA102x 224x224 model trained on ImageNet-1k.

Note

DLA102x 224x224 model from “Deep Layer Aggregation”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> dla102x = flowvision.models.dla102x(pretrained=False, progress=True)
flowvision.models.dla102x2(pretrained=False, progress=True, **kwargs)[source]

Constructs DLA102x2 224x224 model trained on ImageNet-1k.

Note

DLA102x2 224x224 model from “Deep Layer Aggregation”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> dla102x2 = flowvision.models.dla102x2(pretrained=False, progress=True)
flowvision.models.dla169(pretrained=False, progress=True, **kwargs)[source]

Constructs DLA169 224x224 model trained on ImageNet-1k.

Note

DLA169 224x224 model from “Deep Layer Aggregation”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> dla169 = flowvision.models.dla169(pretrained=False, progress=True)
flowvision.models.dla34(pretrained=False, progress=True, **kwargs)[source]

Constructs DLA34 224x224 model trained on ImageNet-1k.

Note

DLA34 224x224 model from “Deep Layer Aggregation”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> dla34 = flowvision.models.dla34(pretrained=False, progress=True)
flowvision.models.dla46_c(pretrained=False, progress=True, **kwargs)[source]

Constructs DLA46_c 224x224 model trained on ImageNet-1k.

Note

DLA46_c 224x224 model from “Deep Layer Aggregation”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> dla46_c = flowvision.models.dla46_c(pretrained=False, progress=True)
flowvision.models.dla46x_c(pretrained=False, progress=True, **kwargs)[source]

Constructs DLA46x_c 224x224 model trained on ImageNet-1k.

Note

DLA46x_c 224x224 model from “Deep Layer Aggregation”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> dla46x_c = flowvision.models.dla46x_c(pretrained=False, progress=True)
flowvision.models.dla60(pretrained=False, progress=True, **kwargs)[source]

Constructs DLA60 224x224 model trained on ImageNet-1k.

Note

DLA60 224x224 model from “Deep Layer Aggregation”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> dla60 = flowvision.models.dla60(pretrained=False, progress=True)
flowvision.models.dla60x(pretrained=False, progress=True, **kwargs)[source]

Constructs DLA60x 224x224 model trained on ImageNet-1k.

Note

DLA60x 224x224 model from “Deep Layer Aggregation”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> dla60x = flowvision.models.dla60x(pretrained=False, progress=True)
flowvision.models.dla60x_c(pretrained=False, progress=True, **kwargs)[source]

Constructs DLA60x_c 224x224 model trained on ImageNet-1k.

Note

DLA60x_c 224x224 model from “Deep Layer Aggregation”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> dla60x_c = flowvision.models.dla60x_c(pretrained=False, progress=True)

GENet

flowvision.models.genet_large(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs GENet-large 256x256 model pretrained on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> genet_large = flowvision.models.genet_large(pretrained=False, progress=True)
flowvision.models.genet_normal(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs GENet-normal 192x192 model pretrained on ImageNet-1k.

Note

GENet-normal 192x192 model from “Neural Architecture Design for GPU-Efficient Networks”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> genet_normal = flowvision.models.genet_normal(pretrained=False, progress=True)
flowvision.models.genet_small(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs GENet-small 192x192 model pretrained on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> genet_small = flowvision.models.genet_small(pretrained=False, progress=True)

HRNet

flowvision.models.hrnet_w18(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs HRNet-w18 224x224 model pretrained on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> hrnet_w18 = flowvision.models.hrnet_w18(pretrained=False, progress=True)
flowvision.models.hrnet_w18_small(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs HRNet-w18-small 224x224 model pretrained on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> hrnet_w18_small = flowvision.models.hrnet_w18_small(pretrained=False, progress=True)
flowvision.models.hrnet_w18_small_v2(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs HRNet-w18-small-v2 224x224 model pretrained on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> hrnet_w18_small_v2 = flowvision.models.hrnet_w18_small_v2(pretrained=False, progress=True)
flowvision.models.hrnet_w30(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs HRNet-w30 224x224 model pretrained on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> hrnet_w30 = flowvision.models.hrnet_w30(pretrained=False, progress=True)
flowvision.models.hrnet_w32(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs HRNet-w32 224x224 model pretrained on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> hrnet_w32 = flowvision.models.hrnet_w32(pretrained=False, progress=True)
flowvision.models.hrnet_w40(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs HRNet-w40 224x224 model pretrained on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> hrnet_w40 = flowvision.models.hrnet_w40(pretrained=False, progress=True)
flowvision.models.hrnet_w44(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs HRNet-w44 224x224 model pretrained on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> hrnet_w44 = flowvision.models.hrnet_w44(pretrained=False, progress=True)
flowvision.models.hrnet_w48(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs HRNet-w48 224x224 model pretrained on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> hrnet_w48 = flowvision.models.hrnet_w48(pretrained=False, progress=True)
flowvision.models.hrnet_w64(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs HRNet-w64 224x224 model pretrained on ImageNet-1k.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> hrnet_w64 = flowvision.models.hrnet_w64(pretrained=False, progress=True)

FAN

flowvision.models.fan_base_16_p4_hybrid(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs FAN-Hybrid-base 224x224 model pretrained on ImageNet-1k.

Note

FAN-Hybrid-base 224x224 model from “Understanding The Robustness in Vision Transformers”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> fan_base_16_p4_hybrid = flowvision.models.fan_base_16_p4_hybrid(pretrained=False, progress=True)
flowvision.models.fan_base_16_p4_hybrid_in22k_1k(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs FAN-Hybrid-base 224x224 model pretrained on ImageNet-21k.

Note

FAN-Hybrid-base 224x224 model from “Understanding The Robustness in Vision Transformers”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> fan_base_16_p4_hybrid_in22k_1k = flowvision.models.fan_base_16_p4_hybrid_in22k_1k(pretrained=False, progress=True)
flowvision.models.fan_base_16_p4_hybrid_in22k_1k_384(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs FAN-Hybrid-base 384x384 model pretrained on ImageNet-21k.

Note

FAN-Hybrid-base 384x384 model from “Understanding The Robustness in Vision Transformers”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> fan_base_16_p4_hybrid_in22k_1k_384 = flowvision.models.fan_base_16_p4_hybrid_in22k_1k_384(pretrained=False, progress=True)
flowvision.models.fan_base_18_p16_224(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs FAN-ViT-base 224x224 model pretrained on ImageNet-1k.

Note

FAN-ViT-base 224x224 model from “Understanding The Robustness in Vision Transformers”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> fan_base_18_p16_224 = flowvision.models.fan_base_18_p16_224(pretrained=False, progress=True)
flowvision.models.fan_large_16_p4_hybrid(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs FAN-Hybrid-large 224x224 model pretrained on ImageNet-1k.

Note

FAN-Hybrid-large 224x224 model from “Understanding The Robustness in Vision Transformers”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> fan_large_16_p4_hybrid = flowvision.models.fan_large_16_p4_hybrid(pretrained=False, progress=True)
flowvision.models.fan_large_16_p4_hybrid_in22k_1k(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs FAN-Hybrid-large 224x224 model pretrained on ImageNet-21k.

Note

FAN-Hybrid-large 224x224 model from “Understanding The Robustness in Vision Transformers”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> fan_large_16_p4_hybrid_in22k_1k = flowvision.models.fan_large_16_p4_hybrid_in22k_1k(pretrained=False, progress=True)
flowvision.models.fan_large_16_p4_hybrid_in22k_1k_384(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs FAN-Hybrid-large 384x384 model pretrained on ImageNet-21k.

Note

FAN-Hybrid-large 384x384 model from “Understanding The Robustness in Vision Transformers”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> fan_large_16_p4_hybrid_in22k_1k_384 = flowvision.models.fan_large_16_p4_hybrid_in22k_1k_384(pretrained=False, progress=True)
flowvision.models.fan_large_24_p16_224(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs FAN-ViT-large 224x224 model pretrained on ImageNet-1k.

Note

FAN-ViT-large 224x224 model from “Understanding The Robustness in Vision Transformers”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> fan_large_24_p16_224 = flowvision.models.fan_large_24_p16_224(pretrained=False, progress=True)
flowvision.models.fan_small_12_p16_224(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs FAN-ViT-small 224x224 model pretrained on ImageNet-1k.

Note

FAN-ViT-small 224x224 model from “Understanding The Robustness in Vision Transformers”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> fan_small_12_p16_224 = flowvision.models.fan_small_12_p16_224(pretrained=False, progress=True)
flowvision.models.fan_small_12_p4_hybrid(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs FAN-Hybrid-small 224x224 model pretrained on ImageNet-1k.

Note

FAN-Hybrid-small 224x224 model from “Understanding The Robustness in Vision Transformers”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> fan_small_12_p4_hybrid = flowvision.models.fan_small_12_p4_hybrid(pretrained=False, progress=True)
flowvision.models.fan_tiny_12_p16_224(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs FAN-ViT-tiny 224x224 model pretrained on ImageNet-1k.

Note

FAN-ViT-tiny 224x224 model from “Understanding The Robustness in Vision Transformers”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> fan_tiny_12_p16_224 = flowvision.models.fan_tiny_12_p16_224(pretrained=False, progress=True)
flowvision.models.fan_tiny_8_p4_hybrid(pretrained: bool = False, progress: bool = True, **kwargs)[source]

Constructs FAN-Hybrid-tiny 224x224 model pretrained on ImageNet-1k.

Note

FAN-Hybrid-tiny 224x224 model from “Understanding The Robustness in Vision Transformers”.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> fan_tiny_8_p4_hybrid = flowvision.models.fan_tiny_8_p4_hybrid(pretrained=False, progress=True)

Neural Style Transfer

flowvision.models.style_transfer.fast_neural_style(pretrained: bool = False, progress: bool = True, style_model: str = 'sketch', **kwargs: Any)flowvision.models.style_transfer.stylenet.FastNeuralStyle[source]

Constructs the Fast Neural Style Transfer model.

Note

Perceptual Losses for Real-Time Style Transfer and Super-Resolution. The required minimum input size of the model is 256x256. For more details for how to use this model, users can refer to: neural_style_transfer project.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on ImageNet. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

  • style_model (str) – Which pretrained style model to download, user can choose from [sketch, candy, mosaic, rain_princess, udnie]. Default: sketch

For example:

>>> import flowvision
>>> stylenet = flowvision.models.style_transfer.fast_neural_style(pretrained=True, progress=True, style_model = "sketch")

Face Recognition

flowvision.models.face_recognition.iresnet101(pretrained=False, progress=True, **kwargs)[source]

Constructs the IResNet-101 model trained on Glint360K(https://github.com/deepinsight/insightface/tree/master/recognition/partial_fc#4-download).

Note

The required input size of the model is 112x112.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on Glint360K. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> iresnet101 = flowvision.models.face_recognition.iresnet101(pretrained=False, progress=True)
flowvision.models.face_recognition.iresnet50(pretrained=False, progress=True, **kwargs)[source]

Constructs the IResNet-50 model trained on webface600K(https://www.face-benchmark.org/download.html).

Note

The required input size of the model is 112x112.

Parameters
  • pretrained (bool) – Whether to download the pre-trained model on webface600K. Default: False

  • progress (bool) – If True, displays a progress bar of the download to stderr. Default: True

For example:

>>> import flowvision
>>> iresnet50 = flowvision.models.face_recognition.iresnet50(pretrained=False, progress=True)

Semantic Segmentation

FCN

flowvision.models.segmentation.fcn_resnet101_coco(pretrained=False, progress=True, num_classes=21, aux_loss=None, **kwargs)[source]

Constructs a Fully-Convolutional Network model with a ResNet-101 backbone.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on COCO train2017 which contains the same classes as Pascal VOC

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • num_classes (int) – number of output classes of the model (including the background)

  • aux_loss (bool) – If True, it uses an auxiliary loss

For example:

>>> import flowvision
>>> deeplabv3_mobilenet_v3_large_coco = flowvision.models.segmentation.fcn_resnet101_coco(pretrained=True, progress=True)
flowvision.models.segmentation.fcn_resnet50_coco(pretrained=False, progress=True, num_classes=21, aux_loss=None, **kwargs)[source]

Constructs a Fully-Convolutional Network model with a ResNet-50 backbone.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on COCO train2017 which contains the same classes as Pascal VOC

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • num_classes (int) – number of output classes of the model (including the background)

  • aux_loss (bool) – If True, it uses an auxiliary loss

For example:

>>> import flowvision
>>> deeplabv3_mobilenet_v3_large_coco = flowvision.models.segmentation.fcn_resnet50_coco(pretrained=True, progress=True)

DeepLabV3

flowvision.models.segmentation.deeplabv3_mobilenet_v3_large_coco(pretrained=False, progress=True, num_classes=21, aux_loss=None, **kwargs)[source]

Constructs a DeepLabV3 model with a MobileNetV3-Large backbone. :param pretrained: If True, returns a model pre-trained on COCO train2017 which

contains the same classes as Pascal VOC

Parameters
  • progress (bool) – If True, displays a progress bar of the download to stderr

  • num_classes (int) – number of output classes of the model (including the background)

  • aux_loss (bool) – If True, it uses an auxiliary loss

For example:

>>> import flowvision
>>> deeplabv3_mobilenet_v3_large_coco = flowvision.models.segmentation.deeplabv3_mobilenet_v3_large_coco(pretrained=True, progress=True)
flowvision.models.segmentation.deeplabv3_resnet101_coco(pretrained=False, progress=True, num_classes=21, aux_loss=None, **kwargs)[source]

Constructs a DeepLabV3 model with a ResNet-101 backbone. :param pretrained: If True, returns a model pre-trained on COCO train2017 which

contains the same classes as Pascal VOC

Parameters
  • progress (bool) – If True, displays a progress bar of the download to stderr

  • num_classes (int) – The number of classes

  • aux_loss (bool) – If True, include an auxiliary classifier

For example:

>>> import flowvision
>>> deeplabv3_resnet101_coco = flowvision.models.segmentation.deeplabv3_resnet101_coco(pretrained=True, progress=True)
flowvision.models.segmentation.deeplabv3_resnet50_coco(pretrained=False, progress=True, num_classes=21, aux_loss=None, **kwargs)[source]

Constructs a DeepLabV3 model with a ResNet-50 backbone. :param pretrained: If True, returns a model pre-trained on COCO train2017 which

contains the same classes as Pascal VOC

Parameters
  • progress (bool) – If True, displays a progress bar of the download to stderr

  • num_classes (int) – number of output classes of the model (including the background)

  • aux_loss (bool) – If True, it uses an auxiliary loss

For example:

>>> import flowvision
>>> deeplabv3_resnet50_coco = flowvision.models.segmentation.deeplabv3_resnet50_coco(pretrained=True, progress=True)

LRASPP

flowvision.models.segmentation.lraspp_mobilenet_v3_large_coco(pretrained=False, progress=True, num_classes=21, **kwargs)[source]

Constructs a Lite R-ASPP Network model with a MobileNetV3-Large backbone. :param pretrained: If True, returns a model pre-trained on COCO train2017 which

contains the same classes as Pascal VOC

Parameters
  • progress (bool) – If True, displays a progress bar of the download to stderr

  • num_classes (int) – number of output classes of the model (including the background)

For example:

>>> import flowvision
>>> lraspp_mobilenet_v3_large_coco = flowvision.models.segmentation.lraspp_mobilenet_v3_large_coco(pretrained=True, progress=True)

Object Detection

Faster R-CNN

flowvision.models.detection.fasterrcnn_mobilenet_v3_large_320_fpn(pretrained: bool = False, progress: bool = True, num_classes: Optional[int] = 91, pretrained_backbone: bool = True, trainable_backbone_layers: Optional[int] = None, **kwargs)[source]

Constructs a low resolution Faster R-CNN model with a MobileNetV3-Large FPN backbone tunned for mobile use-cases. It works similarly to Faster R-CNN with ResNet-50 FPN backbone. See fasterrcnn_resnet50_fpn() for more details.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on COCO train2017

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • num_classes (int) – number of output classes of the model (including the background)

  • pretrained_backbone (bool) – If True, returns a model with backbone pre-trained on Imagenet

  • trainable_backbone_layers (int) – number of trainable (not frozen) resnet layers starting from final block. Valid values are between 0 and 6, with 6 meaning all backbone layers are trainable. If None is passed (the default) this value is set to 3.

For example:

>>> import flowvision
>>> fasterrcnn_mobilenet_v3_large_320_fpn = flowvision.models.detection.fasterrcnn_mobilenet_v3_large_320_fpn(pretrained=False, progress=True)
flowvision.models.detection.fasterrcnn_mobilenet_v3_large_fpn(pretrained: bool = False, progress: bool = True, num_classes: Optional[int] = 91, pretrained_backbone: bool = True, trainable_backbone_layers: Optional[int] = None, **kwargs)[source]

Constructs a high resolution Faster R-CNN model with a MobileNetV3-Large FPN backbone. It works similarly to Faster R-CNN with ResNet-50 FPN backbone. See fasterrcnn_resnet50_fpn() for more details.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on COCO train2017

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • num_classes (int) – number of output classes of the model (including the background)

  • pretrained_backbone (bool) – If True, returns a model with backbone pre-trained on Imagenet

  • trainable_backbone_layers (int) – number of trainable (not frozen) resnet layers starting from final block. Valid values are between 0 and 6, with 6 meaning all backbone layers are trainable. If None is passed (the default) this value is set to 3.

For example:

>>> import flowvision
>>> fasterrcnn_mobilenet_v3_large_fpn = flowvision.models.detection.fasterrcnn_mobilenet_v3_large_fpn(pretrained=False, progress=True)
flowvision.models.detection.fasterrcnn_resnet50_fpn(pretrained: bool = False, progress: bool = True, num_classes: Optional[int] = 91, pretrained_backbone: bool = True, trainable_backbone_layers: Optional[int] = None, **kwargs)[source]

Constructs a Faster R-CNN model with a ResNet-50-FPN backbone.

Reference: “Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks”.

The input to the model is expected to be a list of tensors, each of shape [C, H, W], one for each images, and should be in 0-1 range. Different images can have different sizes.

The behavior of the model changes depending if it is in training or evaluation mode.

During training, the model expects both the input tensors, as well as a targets (list of dictionary), containing:

  • boxes (FloatTensor[N, 4]): the ground-truth boxes in [x1, y1, x2, y2] format, with 0 <= x1 < x2 <= W and 0 <= y1 < y2 <= H.

  • labels (Int64Tensor[N]): the class label for each ground-truth box

The model returns a Dict[Tensor] during training, containing the classification and regression losses for both the RPN and the R-CNN.

During inference, the model requires only the input tensors, and returns the psot-processed predictions as a List[Dict[Tensor]], one for each input image. The fields of the Dict are as follows, where N is the number of detections:

  • boxes (FloatTensor[N, 4]): the predicted boxes in [x1, y1, x2, y2] format, with 0 <= x1 < x2 <= W and 0 <= y1 < y2 <= H.

  • labels (Int64Tensor[N]): the predicted labels for each detection

  • scores (Tensor[N]): the scores of each detection

For more details on the output, you may refer to instance_seg_output.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on COCO train2017

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • num_classes (int) – number of output classes of the model (including the background)

  • pretrained_backbone (bool) – If True, returns a model with backbone pre-trained on Imagenet

  • trainable_backbone_layers (int) – number of trainable (not frozen) resnet layers starting from final block. Valid values are between 0 and 5, with 5 meaning all backbone layers are trainable. If None is passed (the default) this value is set to 3.

For example:

>>> import flowvision
>>> fasterrcnn_resnet50_fpn = flowvision.models.detection.fasterrcnn_resnet50_fpn(pretrained=False, progress=True)

RetinaNet

flowvision.models.detection.retinanet_resnet50_fpn(pretrained: bool = False, progress: bool = True, num_classes: Optional[int] = 91, pretrained_backbone: bool = True, trainable_backbone_layers: Optional[int] = None, **kwargs)[source]

Constructs a RetinaNet model with a ResNet-50-FPN backbone.

Reference: “Focal Loss for Dense Object Detection”.

The input to the model is expected to be a list of tensors, each of shape [C, H, W], one for each image, and should be in 0-1 range. Different images can have different sizes.

The behavior of the model changes depending if it is in training or evaluation mode.

During training, the model expects both the input tensors, as well as a targets (list of dictionary), containing:

  • boxes (FloatTensor[N, 4]): the ground-truth boxes in [x1, y1, x2, y2] format, with 0 <= x1 < x2 <= W and 0 <= y1 < y2 <= H.

  • labels (Int64Tensor[N]): the class label for each ground-truth box

The model returns a Dict[Tensor] during training, containing the classification and regression losses.

During inference, the model requires only the input tensors, and returns the post-processed predictions as a List[Dict[Tensor]], one for each input image. The fields of the Dict are as follows, where N is the number of detections:

  • boxes (FloatTensor[N, 4]): the predicted boxes in [x1, y1, x2, y2] format, with 0 <= x1 < x2 <= W and 0 <= y1 < y2 <= H.

  • labels (Int64Tensor[N]): the predicted labels for each detection

  • scores (Tensor[N]): the scores of each detection

For more details on the output, you may refer to instance_seg_output.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on COCO train2017

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • num_classes (int) – number of output classes of the model (including the background)

  • pretrained_backbone (bool) – If True, returns a model with backbone pre-trained on Imagenet

  • trainable_backbone_layers (int) – number of trainable (not frozen) resnet layers starting from final block. Valid values are between 0 and 5, with 5 meaning all backbone layers are trainable.

For example:

>>> import flowvision
>>> retinanet_resnet50_fpn = flowvision.models.detection.retinanet_resnet50_fpn(pretrained=False, progress=True)

SSD

flowvision.models.detection.ssd300_vgg16(pretrained: bool = False, progress: bool = True, num_classes: int = 91, pretrained_backbone: bool = True, trainable_backbone_layers: Optional[int] = None, **kwargs: Any)[source]

Constructs an SSD model with input size 300x300 and a VGG16 backbone.

Reference: “SSD: Single Shot MultiBox Detector”.

The input to the model is expected to be a list of tensors, each of shape [C, H, W], one for each image, and should be in 0-1 range. Different images can have different sizes but they will be resized to a fixed size before passing it to the backbone.

The behavior of the model changes depending if it is in training or evaluation mode.

During training, the model expects both the input tensors, as well as a targets (list of dictionary), containing:

  • boxes (FloatTensor[N, 4]): the ground-truth boxes in [x1, y1, x2, y2] format, with 0 <= x1 < x2 <= W and 0 <= y1 < y2 <= H.

  • labels (Int64Tensor[N]): the class label for each ground-truth box

The model returns a Dict[Tensor] during training, containing the classification and regression losses.

During inference, the model requires only the input tensors, and returns the post-processed predictions as a List[Dict[Tensor]], one for each input image. The fields of the Dict are as follows, where N is the number of detections:

  • boxes (FloatTensor[N, 4]): the predicted boxes in [x1, y1, x2, y2] format, with 0 <= x1 < x2 <= W and 0 <= y1 < y2 <= H.

  • labels (Int64Tensor[N]): the predicted labels for each detection

  • scores (Tensor[N]): the scores for each detection

Example:

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on COCO train2017

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • num_classes (int) – number of output classes of the model (including the background)

  • pretrained_backbone (bool) – If True, returns a model with backbone pre-trained on Imagenet

  • trainable_backbone_layers (int) – number of trainable (not frozen) resnet layers starting from final block. Valid values are between 0 and 5, with 5 meaning all backbone layers are trainable.

For example:

>>> import flowvision
>>> ssd300_vgg16 = flowvision.models.detection.ssd300_vgg16(pretrained=False, progress=True)

SSDLite

flowvision.models.detection.ssdlite320_mobilenet_v3_large(pretrained: bool = False, progress: bool = True, num_classes: int = 91, pretrained_backbone: bool = False, trainable_backbone_layers: Optional[int] = None, norm_layer: Optional[Callable[[], oneflow.nn.modules.module.Module]] = None, **kwargs: Any)[source]

Constructs an SSDlite model with input size 320x320 and a MobileNetV3 Large backbone, as described at “Searching for MobileNetV3” and “MobileNetV2: Inverted Residuals and Linear Bottlenecks”.

See ssd300_vgg16() for more details.

Parameters
  • pretrained (bool) – If True, returns a model pre-trained on COCO train2017

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • num_classes (int) – number of output classes of the model (including the background)

  • pretrained_backbone (bool) – If True, returns a model with backbone pre-trained on Imagenet

  • trainable_backbone_layers (int) – number of trainable (not frozen) resnet layers starting from final block. Valid values are between 0 and 6, with 6 meaning all backbone layers are trainable.

  • norm_layer (callable, optional) – Module specifying the normalization layer to use.

For example:

>>> import flowvision
>>> ssdlite320_mobilenet_v3_large = flowvision.models.detection.ssdlite320_mobilenet_v3_large(pretrained=False, progress=True)