class_docstr: This is the configuration class to store the configuration of a [`Mask2FormerModel`]. It is used to instantiate a
  Mask2Former model according to the specified arguments, defining the model architecture. Instantiating a
  configuration with the defaults will yield a similar configuration to that of the Mask2Former
  [facebook/mask2former-swin-small-coco-instance](https://huggingface.co/facebook/mask2former-swin-small-coco-instance)
  architecture.
  
  Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
  documentation from [`PretrainedConfig`] for more information.
  
  Currently, Mask2Former only supports the [Swin Transformer](swin) as backbone.
  
  Args:
      backbone_config (`PretrainedConfig` or `dict`, *optional*, defaults to `SwinConfig()`):
          The configuration of the backbone model. If unset, the configuration corresponding to
          `swin-base-patch4-window12-384` will be used.
      feature_size (`int`, *optional*, defaults to 256):
          The features (channels) of the resulting feature maps.
      mask_feature_size (`int`, *optional*, defaults to 256):
          The masks' features size, this value will also be used to specify the Feature Pyramid Network features'
          size.
      hidden_dim (`int`, *optional*, defaults to 256):
          Dimensionality of the encoder layers.
      encoder_feedforward_dim (`int`, *optional*, defaults to 1024):
          Dimension of feedforward network for deformable detr encoder used as part of pixel decoder.
      encoder_layers (`int`, *optional*, defaults to 6):
          Number of layers in the deformable detr encoder used as part of pixel decoder.
      decoder_layers (`int`, *optional*, defaults to 10):
          Number of layers in the Transformer decoder.
      num_attention_heads (`int`, *optional*, defaults to 8):
          Number of attention heads for each attention layer.
      dropout (`float`, *optional*, defaults to 0.1):
          The dropout probability for all fully connected layers in the embeddings, encoder.
      dim_feedforward (`int`, *optional*, defaults to 2048):
          Feature dimension in feedforward network for transformer decoder.
      pre_norm (`bool`, *optional*, defaults to `False`):
          Whether to use pre-LayerNorm or not for transformer decoder.
      enforce_input_projection (`bool`, *optional*, defaults to `False`):
          Whether to add an input projection 1x1 convolution even if the input channels and hidden dim are identical
          in the Transformer decoder.
      common_stride (`int`, *optional*, defaults to 4):
          Parameter used for determining number of FPN levels used as part of pixel decoder.
      ignore_value (`int`, *optional*, defaults to 255):
          Category id to be ignored during training.
      num_queries (`int`, *optional*, defaults to 100):
          Number of queries for the decoder.
      no_object_weight (`int`, *optional*, defaults to 0.1):
          The weight to apply to the null (no object) class.
      class_weight (`int`, *optional*, defaults to 2.0):
          The weight for the cross entropy loss.
      mask_weight (`int`, *optional*, defaults to 5.0):
          The weight for the mask loss.
      dice_weight (`int`, *optional*, defaults to 5.0):
          The weight for the dice loss.
      train_num_points (`str` or `function`, *optional*, defaults to 12544):
          Number of points used for sampling during loss calculation.
      oversample_ratio (`float`, *optional*, defaults to 3.0):
          Oversampling parameter used for calculating no. of sampled points
      importance_sample_ratio (`float`, *optional*, defaults to 0.75):
          Ratio of points that are sampled via importance sampling.
      init_std (`float`, *optional*, defaults to 0.02):
          The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
      init_xavier_std (`float`, *optional*, defaults to 1.0):
          The scaling factor used for the Xavier initialization gain in the HM Attention map module.
      use_auxiliary_loss (`boolean``, *optional*, defaults to `True`):
          If `True` [`Mask2FormerForUniversalSegmentationOutput`] will contain the auxiliary losses computed using
          the logits from each decoder's stage.
      feature_strides (`List[int]`, *optional*, defaults to `[4, 8, 16, 32]`):
          Feature strides corresponding to features generated from backbone network.
      output_auxiliary_logits (`bool`, *optional*):
          Should the model output its `auxiliary_logits` or not.
  
  Examples:
  
  ```python
  >>> from transformers import Mask2FormerConfig, Mask2FormerModel
  
  >>> # Initializing a Mask2Former facebook/mask2former-swin-small-coco-instance configuration
  >>> configuration = Mask2FormerConfig()
  
  >>> # Initializing a model (with random weights) from the facebook/mask2former-swin-small-coco-instance style configuration
  >>> model = Mask2FormerModel(configuration)
  
  >>> # Accessing the model configuration
  >>> configuration = model.config
  ```
docstr: Instantiate a [`Mask2FormerConfig`] (or a derived class) from a pre-trained backbone model configuration.
  
  Args:
      backbone_config ([`PretrainedConfig`]):
          The backbone configuration.
  
  Returns:
      [`Mask2FormerConfig`]: An instance of a configuration object
docstr_tok: ["Instantiate","a","[","`","Mask2FormerConfig","`","]","(","or","a","derived","class",")","from","a","pre-trained","backbone","model","configuration",".","Args",":","backbone_config","(","[","`","PretrainedConfig","`","]",")",":","The","backbone","configuration",".","Returns",":","[","`","Mask2FormerConfig","`","]",":","An","instance","of","a","configuration","object"]
code: def from_backbone_config(
      cls, backbone_config: PretrainedConfig, **kwargs
  ):
      """Instantiate a [`Mask2FormerConfig`] (or a derived class) from a pre-trained backbone model configuration.
  
      Args:
          backbone_config ([`PretrainedConfig`]):
              The backbone configuration.
  
      Returns:
          [`Mask2FormerConfig`]: An instance of a configuration object
      """
      return cls(
          backbone_config=backbone_config,
          **kwargs,
      )
  
imports: from typing import Dict, List, Optional
  from ...configuration_utils import PretrainedConfig
  from ...utils import logging
  from ..auto import CONFIG_MAPPING
label_desc: Use image node_id 2 for calling the Mask2FormerConfig obj's underlying member method code with example usage: obj.from_backbone_config(cls, backbone_config) and returns: cls