
    fTh}                         S r SSKrSSKJr  SSKJr  SSKJr  SSKJ	r	  SS	K
Jr  \R                  " \5      r " S
 S\5      rS/rg)zVitMatte model configuration    N)List   )PretrainedConfig)logging) verify_backbone_config_arguments   )CONFIG_MAPPINGc                   ~   ^  \ rS rSrSrSrSSSSSSSS/ S	Q/ S
Q4
S\S\S\S\S\	\   S\	\   4U 4S jjjr
S rSrU =r$ )VitMatteConfig   a
  
This is the configuration class to store the configuration of [`VitMatteForImageMatting`]. It is used to
instantiate a ViTMatte 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 ViTMatte
[hustvl/vitmatte-small-composition-1k](https://huggingface.co/hustvl/vitmatte-small-composition-1k) architecture.

Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
documentation from [`PretrainedConfig`] for more information.

Args:
    backbone_config (`PretrainedConfig` or `dict`, *optional*, defaults to `VitDetConfig()`):
        The configuration of the backbone model.
    backbone (`str`, *optional*):
        Name of backbone to use when `backbone_config` is `None`. If `use_pretrained_backbone` is `True`, this
        will load the corresponding pretrained weights from the timm or transformers library. If `use_pretrained_backbone`
        is `False`, this loads the backbone's config and uses that to initialize the backbone with random weights.
    use_pretrained_backbone (`bool`, *optional*, defaults to `False`):
        Whether to use pretrained weights for the backbone.
    use_timm_backbone (`bool`, *optional*, defaults to `False`):
        Whether to load `backbone` from the timm library. If `False`, the backbone is loaded from the transformers
        library.
    backbone_kwargs (`dict`, *optional*):
        Keyword arguments to be passed to AutoBackbone when loading from a checkpoint
        e.g. `{'out_indices': (0, 1, 2, 3)}`. Cannot be specified if `backbone_config` is set.
    hidden_size (`int`, *optional*, defaults to 384):
        The number of input channels of the decoder.
    batch_norm_eps (`float`, *optional*, defaults to 1e-05):
        The epsilon used by the batch norm layers.
    initializer_range (`float`, *optional*, defaults to 0.02):
        The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
    convstream_hidden_sizes (`List[int]`, *optional*, defaults to `[48, 96, 192]`):
        The output channels of the ConvStream module.
    fusion_hidden_sizes (`List[int]`, *optional*, defaults to `[256, 128, 64, 32]`):
        The output channels of the Fusion blocks.

Example:

```python
>>> from transformers import VitMatteConfig, VitMatteForImageMatting

>>> # Initializing a ViTMatte hustvl/vitmatte-small-composition-1k style configuration
>>> configuration = VitMatteConfig()

>>> # Initializing a model (with random weights) from the hustvl/vitmatte-small-composition-1k style configuration
>>> model = VitMatteForImageMatting(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
```vitmatteNFi  gh㈵>g{Gz?)0   `      )      @       backbone_confighidden_sizebatch_norm_epsinitializer_rangeconvstream_hidden_sizesfusion_hidden_sizesc                   > [         TU ]  " S0 UD6  Uc'  Uc$  [        R                  S5        [        S   " S/S9nO@[        U[        5      (       a+  UR                  S5      n[        U   nUR                  U5      n[        UUUUUS9  Xl
        X l        X0l        X@l        XPl        Xpl        X`l        Xl        Xl        Xl        g )NzX`backbone_config` is `None`. Initializing the config with the default `VitDet` backbone.vitdetstage4)out_features
model_type)use_timm_backboneuse_pretrained_backbonebackboner   backbone_kwargs )super__init__loggerinfor	   
isinstancedictget	from_dictr   r   r"   r!   r    r#   r   r   r   r   r   )selfr   r"   r!   r    r#   r   r   r   r   r   kwargsbackbone_model_typeconfig_class	__class__s                 k/var/www/auris/envauris/lib/python3.13/site-packages/transformers/models/vitmatte/configuration_vitmatte.pyr&   VitMatteConfig.__init__R   s     	"6""x'7KKrs,X6XJOO.."1"5"5l"C)*=>L*44_EO(/$;++	
  / '>$!2.,&!2'>$#6     c                     [         R                  " U R                  5      nU R                  R	                  5       US'   U R
                  R                  US'   U$ )z
Serializes this instance to a Python dictionary. Override the default [`~PretrainedConfig.to_dict`]. Returns:
    `Dict[str, any]`: Dictionary of all the attributes that make up this configuration instance,
r   r   )copydeepcopy__dict__r   to_dictr1   r   )r-   outputs     r2   r9   VitMatteConfig.to_dict}   sI    
 t}}-$($8$8$@$@$B !#~~88|r4   )
r"   r   r#   r   r   r   r   r   r!   r    )__name__
__module____qualname____firstlineno____doc__r   r   intfloatr   r&   r9   __static_attributes____classcell__)r1   s   @r2   r   r      s    0d J -1 % $#'-:);)7))7 )7 )7 !)7 "&c)7 "#Y)7 )7V r4   r   )r@   r6   typingr   configuration_utilsr   utilsr   utils.backbone_utilsr   auto.configuration_autor	   
get_loggerr<   r'   r   __all__r$   r4   r2   <module>rL      sH    #   3  D 4 
		H	%h% hV 
r4   