Ë
    T^(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               €úo/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/transformers/models/vitpose/configuration_vitpose.pyr   zVitPoseConfig.__init__N   sð   ø€ ô 	‰ÑÑ"˜6Ò"á"Ü�K‰KØ~ôñ ÜÐ[Ó\Ð\àÐ" xÐ'7Ü�K‰KÐsÔtÜ,Ð-?Ñ@ÈaÈSÔQ‰OÜ˜¬Ô.Ø"1×"5Ñ"5°lÓ"CÐÜ)Ð*=Ñ>ˆLØ*×4Ñ4°_ÓEˆOä(Ø/Ø$;ØØ+Ø+õ	
ð  /ˆÔØ ˆŒØ'>ˆÔ$Ø!2ˆÔØ.ˆÔà!2ˆÔØ(ˆÔØ"4ˆÕó    )NNFFNg{®Gáz”?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Ð$ô _5ðD Ð
�r*   