Skip to content
fn

maskformer_resnet101

→MaskFormerForSemanticSegmentation
maskformer_resnet101(pretrained: bool | str = False, weights: MaskFormerResNet101Weights | None = None, overrides: object = {})

MaskFormer with ResNet-101 backbone (Cheng et al., NeurIPS 2021).

Builds a MaskFormerForSemanticSegmentation with the same transformer head as maskformer_resnet50 but a deeper ResNet-101 backbone ([3, 4, 23, 3] bottleneck blocks). Reaches ADE20K validation mIoU of 45.5% (paper Table 3, MaskFormer-R101 row).

Model Size

Parameters

pretrainedbool or str= False
Pretrained-weight selector. False → random init; True → the DEFAULT tag (MaskFormerResNet101Weights.ADE20K); a tag string → that specific checkpoint. Mutually exclusive with weights (which wins if both are given).
weights(MaskFormerResNet101Weights, optional, keyword - only)= None
Explicit weights enum member. Takes precedence over pretrained.
**overridesobject= {}
Keyword overrides forwarded into MaskFormerConfig.

Returns

MaskFormerForSemanticSegmentation

Segmentation model with the MaskFormer-R101 configuration applied (or with overrides merged on top of it).

Notes

See Cheng et al., "Per-Pixel Classification is Not All You Need for Semantic Segmentation", NeurIPS 2021 (arXiv:2107.06278). Switching backbones is the only change versus maskformer_resnet50; all transformer-head hyperparameters are shared. Pretrained weights are converted from the facebook/maskformer-resnet101-ade checkpoint and hosted under lucid-dl/maskformer-resnet-101.

Examples

>>> import lucid
>>> from lucid.models.vision.maskformer import maskformer_resnet101
>>> model = maskformer_resnet101()
>>> x = lucid.randn(1, 3, 512, 512)
>>> out = model(x)
>>> out.logits.shape[1]
150

Used by 1