from transformers import MaskFormerConfig, MaskFormerForInstanceSegmentation, ResNetConfig | |
config = MaskFormerConfig(backbone="microsoft/resnet50", use_pretrained_backbone=False) # backbone and neck config | |
model = MaskFormerForInstanceSegmentation(config) # head | |
You could also load the backbone config separately and then pass it to the model config. |