Skip to content
fn

mask2former_swin_large

→Mask2FormerForSemanticSegmentation
mask2former_swin_large(pretrained: bool | str = False, weights: Mask2FormerSwinLargeWeights | None = None, overrides: object = {})

Mask2Former with Swin-Large backbone (Cheng et al., CVPR 2022).

Builds a Mask2FormerForSemanticSegmentation with the largest Swin backbone (embed_dim = 192, depths = (2, 2, 18, 2), num_heads = (6, 12, 24, 48)). Reaches ADE20K validation mIoU of 56.1% — the headline result of the paper.

Model Size

Parameters

pretrainedbool or str= False
Pretrained-weight selector. False → random init; True → the DEFAULT tag; a tag string → that specific checkpoint.
weights(Mask2FormerSwinLargeWeights, optional, keyword - only)= None
Explicit weights enum member. Takes precedence over pretrained.
**overridesobject= {}
Keyword overrides forwarded into Mask2FormerConfig.

Returns

Mask2FormerForSemanticSegmentation

Segmentation model with the Mask2Former-Swin-L configuration applied (or with overrides merged on top of it).

Examples

>>> import lucid
>>> from lucid.models.vision.mask2former import mask2former_swin_large
>>> model = mask2former_swin_large()
>>> x = lucid.randn(1, 3, 384, 384)
>>> out = model(x)
>>> out.logits.shape[1]
150

Used by 1