fcn_resnet50(pretrained: bool | str = False, weights: FCNResNet50Weights | None = None, overrides: object = {})FCN with ResNet-50 backbone (Long et al., CVPR 2015).
Builds an FCNForSemanticSegmentation with a dilated
ResNet-50 backbone (layer3 dilation = 2, layer4 dilation = 4),
21 output classes (Pascal VOC default), a 512-channel main FCN head,
and a 256-channel auxiliary head. The dilation trick keeps the
final feature map at stride 8 instead of stride 32, retaining 16x
more spatial sampling for dense prediction.
Model Size
Parameters
pretrainedbool or str= FalseFalse → random init; True →
the DEFAULT tag (FCNResNet50Weights.COCO_WITH_VOC_LABELS_V1);
a tag string → that specific checkpoint. Mutually exclusive with
weights (which wins if both are given).pretrained.**overridesobject= {}FCNConfig (num_classes,
in_channels, classifier_hidden_channels, dropout, ...).Returns
FCNForSemanticSegmentationSegmentation model with the FCN-R50 configuration applied (or
with overrides merged on top of it).
Notes
See Long et al., "Fully Convolutional Networks for Semantic Segmentation", CVPR 2015 (arXiv:1411.4038). The dilated variant follows the DeepLab v1 trick (Chen et al., 2015) of replacing stride-2 downsampling in layer3 / layer4 with atrous convolution.
Examples
>>> import lucid
>>> from lucid.models.vision.fcn import fcn_resnet50
>>> model = fcn_resnet50()
>>> x = lucid.randn(1, 3, 512, 512)
>>> out = model(x)
>>> out.logits.shape
(1, 21, 512, 512)