Set use_pretrained_backbone=True to load pretrained ResNet weights for the backbone.

from transformers import MaskFormerConfig, MaskFormerForInstanceSegmentation, ResNetConfig
config = MaskFormerConfig(backbone="microsoft/resnet50", use_pretrained_backbone=True) # backbone and neck config
model = MaskFormerForInstanceSegmentation(config) # head

You could also load the backbone config separately and then pass it to the model config.