
    %	&h                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
  ej                  e      Z G d	 d
e      Zd
gZy)zVitPose model configuration    )Optional   )PretrainedConfig)logging) verify_backbone_config_arguments   )CONFIG_MAPPINGc                   l     e Zd ZdZdZ	 	 	 	 	 	 	 	 ddee   dee   dededee	   de
d	ed
ef fdZ xZS )VitPoseConfiga
  
    This is the configuration class to store the configuration of a [`VitPoseForPoseEstimation`]. It is used to instantiate a
    VitPose 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 VitPose
    [usyd-community/vitpose-base-simple](https://huggingface.co/usyd-community/vitpose-base-simple) 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 `VitPoseBackboneConfig()`):
            The configuration of the backbone model. Currently, only `backbone_config` with `vitpose_backbone` as `model_type` is supported.
        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.
        initializer_range (`float`, *optional*, defaults to 0.02):
            The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
        scale_factor (`int`, *optional*, defaults to 4):
            Factor to upscale the feature maps coming from the ViT backbone.
        use_simple_decoder (`bool`, *optional*, defaults to `True`):
            Whether to use a `VitPoseSimpleDecoder` to decode the feature maps from the backbone into heatmaps. Otherwise it uses `VitPoseClassicDecoder`.


    Example:

    ```python
    >>> from transformers import VitPoseConfig, VitPoseForPoseEstimation

    >>> # Initializing a VitPose configuration
    >>> configuration = VitPoseConfig()

    >>> # Initializing a model (with random weights) from the configuration
    >>> model = VitPoseForPoseEstimation(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```vitposebackbone_configbackboneuse_pretrained_backboneuse_timm_backbonebackbone_kwargsinitializer_rangescale_factoruse_simple_decoderc	                    t        |   d	i |	 |rt        j                  d       |rt	        d      |(|&t        j                  d       t        d   dg      }n;t        |t              r+|j                  d      }
t
        |
   }|j                  |      }t        |||||       || _        || _        || _        || _        || _        || _        || _        || _        y )
Nzl`use_pretrained_backbone` is `True`. For the pure inference purpose of VitPose weight do not set this value.z<use_timm_backbone set `True` is not supported at the moment.zY`backbone_config` is `None`. Initializing the config with the default `VitPose` backbone.vitpose_backbone   )out_indices
model_type)r   r   r   r   r    )super__init__loggerinfo
ValueErrorr	   
isinstancedictget	from_dictr   r   r   r   r   r   r   r   r   )selfr   r   r   r   r   r   r   r   kwargsbackbone_model_typeconfig_class	__class__s               /var/www/pru.catia.catastroantioquia-mas.com/valormas/lib/python3.12/site-packages/transformers/models/vitpose/configuration_vitpose.pyr   zVitPoseConfig.__init__N   s     	"6""KK~ [\\"x'7KKst,-?@aSQO."1"5"5l"C)*=>L*44_EO(/$;++	
  / '>$!2.!2("4    )NNFFNg{Gz?r   T)__name__
__module____qualname____doc__r   r   r   strboolr!   floatintr   __classcell__)r(   s   @r)   r   r      s    -^ J 7;"&(-"'*.#'#'-5!"23-5 3--5 "&	-5
  -5 "$-5 !-5 -5 !-5 -5r*   r   N)r.   typingr   configuration_utilsr   utilsr   utils.backbone_utilsr   auto.configuration_autor	   
get_loggerr+   r   r   __all__r   r*   r)   <module>r;      sG    "  3  D 4 
		H	%_5$ _5D 
r*   