Shortcuts

SwinTransformer

The SwinTransformer models are based on the Swin Transformer: Hierarchical Vision Transformer using Shifted Windows paper. SwinTransformer V2 models are based on the Swin Transformer V2: Scaling Up Capacity and Resolution paper.

Model builders

The following model builders can be used to instantiate an SwinTransformer model (original and V2) with and without pre-trained weights. All the model builders internally rely on the torchvision.models.swin_transformer.SwinTransformer base class. Please refer to the source code for more details about this class.

swin_t(*[, weights, progress])

Constructs a swin_tiny architecture from Swin Transformer: Hierarchical Vision Transformer using Shifted Windows.

swin_s(*[, weights, progress])

Constructs a swin_small architecture from Swin Transformer: Hierarchical Vision Transformer using Shifted Windows.

swin_b(*[, weights, progress])

Constructs a swin_base architecture from Swin Transformer: Hierarchical Vision Transformer using Shifted Windows.

swin_v2_t(*[, weights, progress])

Constructs a swin_v2_tiny architecture from Swin Transformer V2: Scaling Up Capacity and Resolution.

swin_v2_s(*[, weights, progress])

Constructs a swin_v2_small architecture from Swin Transformer V2: Scaling Up Capacity and Resolution.

swin_v2_b(*[, weights, progress])

Constructs a swin_v2_base architecture from Swin Transformer V2: Scaling Up Capacity and Resolution.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources