Ë
    T^(hÕ1  ã                   óv   — d Z ddlmZ ddlmZ ddlmZ  ej                  e«      Z	ddiZ
 G d„ d	e«      Zd
d	gZy)zZoeDepth model configurationé   )ÚPretrainedConfig)Úloggingé   )ÚCONFIG_MAPPINGzIntel/zoedepth-nyuzBhttps://huggingface.co/Intel/zoedepth-nyu/resolve/main/config.jsonc                   óz   ‡ — e Zd ZdZdZddddddddg d	¢g d
¢dddddddg d¢dddddddddddœgddddfˆ fd„	Zˆ xZS )ÚZoeDepthConfiga�  
    This is the configuration class to store the configuration of a [`ZoeDepthForDepthEstimation`]. It is used to instantiate an ZoeDepth
    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 ZoeDepth
    [Intel/zoedepth-nyu](https://huggingface.co/Intel/zoedepth-nyu) 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 (`Union[Dict[str, Any], PretrainedConfig]`, *optional*, defaults to `BeitConfig()`):
            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.
        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_act (`str` or `function`, *optional*, defaults to `"gelu"`):
            The non-linear activation function (function or string) in the encoder and pooler. If string, `"gelu"`,
            `"relu"`, `"selu"` and `"gelu_new"` are supported.
        initializer_range (`float`, *optional*, defaults to 0.02):
            The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
        batch_norm_eps (`float`, *optional*, defaults to 1e-05):
            The epsilon used by the batch normalization layers.
        readout_type (`str`, *optional*, defaults to `"project"`):
            The readout type to use when processing the readout token (CLS token) of the intermediate hidden states of
            the ViT backbone. Can be one of [`"ignore"`, `"add"`, `"project"`].

            - "ignore" simply ignores the CLS token.
            - "add" passes the information from the CLS token to all other tokens by adding the representations.
            - "project" passes information to the other tokens by concatenating the readout to all other tokens before
              projecting the
            representation to the original feature dimension D using a linear layer followed by a GELU non-linearity.
        reassemble_factors (`List[int]`, *optional*, defaults to `[4, 2, 1, 0.5]`):
            The up/downsampling factors of the reassemble layers.
        neck_hidden_sizes (`List[str]`, *optional*, defaults to `[96, 192, 384, 768]`):
            The hidden sizes to project to for the feature maps of the backbone.
        fusion_hidden_size (`int`, *optional*, defaults to 256):
            The number of channels before fusion.
        head_in_index (`int`, *optional*, defaults to -1):
            The index of the features to use in the heads.
        use_batch_norm_in_fusion_residual (`bool`, *optional*, defaults to `False`):
            Whether to use batch normalization in the pre-activate residual units of the fusion blocks.
        use_bias_in_fusion_residual (`bool`, *optional*, defaults to `True`):
            Whether to use bias in the pre-activate residual units of the fusion blocks.
        num_relative_features (`int`, *optional*, defaults to 32):
            The number of features to use in the relative depth estimation head.
        add_projection (`bool`, *optional*, defaults to `False`):
            Whether to add a projection layer before the depth estimation head.
        bottleneck_features (`int`, *optional*, defaults to 256):
            The number of features in the bottleneck layer.
        num_attractors (`List[int], *optional*, defaults to `[16, 8, 4, 1]`):
            The number of attractors to use in each stage.
        bin_embedding_dim (`int`, *optional*, defaults to 128):
            The dimension of the bin embeddings.
        attractor_alpha (`int`, *optional*, defaults to 1000):
            The alpha value to use in the attractor.
        attractor_gamma (`int`, *optional*, defaults to 2):
            The gamma value to use in the attractor.
        attractor_kind (`str`, *optional*, defaults to `"mean"`):
            The kind of attractor to use. Can be one of [`"mean"`, `"sum"`].
        min_temp (`float`, *optional*, defaults to 0.0212):
            The minimum temperature value to consider.
        max_temp (`float`, *optional*, defaults to 50.0):
            The maximum temperature value to consider.
        bin_centers_type (`str`, *optional*, defaults to `"softplus"`):
            Activation type used for bin centers. Can be "normed" or "softplus". For "normed" bin centers, linear normalization trick
            is applied. This results in bounded bin centers. For "softplus", softplus activation is used and thus are unbounded.
        bin_configurations (`List[dict]`, *optional*, defaults to `[{'n_bins': 64, 'min_depth': 0.001, 'max_depth': 10.0}]`):
            Configuration for each of the bin heads.
            Each configuration should consist of the following keys:
            - name (`str`): The name of the bin head - only required in case of multiple bin configurations.
            - `n_bins` (`int`): The number of bins to use.
            - `min_depth` (`float`): The minimum depth value to consider.
            - `max_depth` (`float`): The maximum depth value to consider.
            In case only a single configuration is passed, the model will use a single head with the specified configuration.
            In case multiple configurations are passed, the model will use multiple heads with the specified configurations.
        num_patch_transformer_layers (`int`, *optional*):
            The number of transformer layers to use in the patch transformer. Only used in case of multiple bin configurations.
        patch_transformer_hidden_size (`int`, *optional*):
            The hidden size to use in the patch transformer. Only used in case of multiple bin configurations.
        patch_transformer_intermediate_size (`int`, *optional*):
            The intermediate size to use in the patch transformer. Only used in case of multiple bin configurations.
        patch_transformer_num_attention_heads (`int`, *optional*):
            The number of attention heads to use in the patch transformer. Only used in case of multiple bin configurations.

    Example:

    ```python
    >>> from transformers import ZoeDepthConfig, ZoeDepthForDepthEstimation

    >>> # Initializing a ZoeDepth zoedepth-large style configuration
    >>> configuration = ZoeDepthConfig()

    >>> # Initializing a model from the zoedepth-large style configuration
    >>> model = ZoeDepthForDepthEstimation(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```ÚzoedepthNFÚgelug{®Gáz”?gñhãˆµøä>Úproject)é   r   é   g      à?)é`   éÀ   é€  i   é   éÿÿÿÿé    )é   é   r   r   é€   iè  r   Úmeang¡g³êsµ•?g      I@Úsoftplusé@   gü©ñÒMbP?g      $@)Ún_binsÚ	min_depthÚ	max_depthc                 ó*  •— t        ‰"| �  di |¤Ž |dvrt        d«      ‚|dvrt        d«      ‚|rt        d«      ‚|�|�t        d«      ‚|€0|€.t        j	                  d«       t        d   d	d
dddddg d¢¬«      }n;t        |t        «      r+|j                  d«      } t
        |    }!|!j                  |«      }|�|r|�t        d«      ‚|| _
        || _        || _        || _        || _        || _        || _        |	| _        |
| _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _         || _!        || _"        || _#        || _$        || _%        || _&        y )N)ÚignoreÚaddr   z8Readout_type must be one of ['ignore', 'add', 'project'])r   Úsumz-Attractor_kind must be one of ['mean', 'sum']z+Pretrained backbones are not supported yet.z8You can't specify both `backbone` and `backbone_config`.zV`backbone_config` is `None`. Initializing the config with the default `BEiT` backbone.Úbeitr   é   i   i   r   TF)Ústage6Ústage12Ústage18Ústage24)Ú
image_sizeÚnum_hidden_layersÚhidden_sizeÚintermediate_sizeÚnum_attention_headsÚuse_relative_position_biasÚreshape_hidden_statesÚout_featuresÚ
model_typez?You can't specify both `backbone_kwargs` and `backbone_config`.© )'ÚsuperÚ__init__Ú
ValueErrorÚloggerÚinfor   Ú
isinstanceÚdictÚgetÚ	from_dictÚbackbone_configÚbackboneÚ
hidden_actÚuse_pretrained_backboneÚinitializer_rangeÚbatch_norm_epsÚreadout_typeÚreassemble_factorsÚneck_hidden_sizesÚfusion_hidden_sizeÚhead_in_indexÚ!use_batch_norm_in_fusion_residualÚuse_bias_in_fusion_residualÚnum_relative_featuresÚadd_projectionÚbottleneck_featuresÚnum_attractorsÚbin_embedding_dimÚattractor_alphaÚattractor_gammaÚattractor_kindÚmin_tempÚmax_tempÚbin_centers_typeÚbin_configurationsÚnum_patch_transformer_layersÚpatch_transformer_hidden_sizeÚ#patch_transformer_intermediate_sizeÚ%patch_transformer_num_attention_heads)#Úselfr:   r;   r=   Úbackbone_kwargsr<   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   ÚkwargsÚbackbone_model_typeÚconfig_classÚ	__class__s#                                     €úq/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/transformers/models/zoedepth/configuration_zoedepth.pyr2   zZoeDepthConfig.__init__‰   sÙ  ø€ ôD 	‰ÑÑ"˜6Ò"àÐ;Ñ;ÜÐWÓXÐXà Ñ0ÜÐLÓMÐMá"ÜÐJÓKÐKàÐ&¨8Ð+?ÜÐWÓXÐXàÐ" xÐ'7Ü�K‰KÐpÔqÜ,¨VÑ4ØØ"$Ø Ø"&Ø$&Ø+/Ø&+ÚHô	‰Oô ˜¬Ô.Ø"1×"5Ñ"5°lÓ"CÐÜ)Ð*=Ñ>ˆLØ*×4Ñ4°_ÓEˆOàÐ&©?¸Ð?ZÜÐ^Ó_Ð_à.ˆÔØ ˆŒØ$ˆŒØ'>ˆÔ$Ø!2ˆÔØ,ˆÔØ(ˆÔØ"4ˆÔØ!2ˆÔØ"4ˆÔØ*ˆÔØ1RˆÔ.Ø+FˆÔ(Ø%:ˆÔ"Ø,ˆÔà#6ˆÔ Ø,ˆÔØ!2ˆÔØ.ˆÔØ.ˆÔØ,ˆÔØ ˆŒØ ˆŒØ 0ˆÔØ"4ˆÔØ,HˆÔ)Ø-JˆÔ*Ø3VˆÔ0Ø5ZˆÕ2ó    )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r/   r2   Ú__classcell__)r\   s   @r]   r   r      s…   ø„ ñgðR €Jð ØØ %ØØØØØÚ)Ú-ØØØ*/Ø$(Ø ØØÚ$ØØØØØØØ#Ø')¸ÈDÑQÐRØ%)Ø&*Ø,0Ø.2÷?a[ñ a[r^   r   Ú&ZOEDEPTH_PRETRAINED_CONFIG_ARCHIVE_MAPN)rb   Úconfiguration_utilsr   Úutilsr   Úauto.configuration_autor   Ú
get_loggerr_   r4   rd   r   Ú__all__r0   r^   r]   ú<module>rj      sV   ðñ #å 3Ý Ý 4ð 
ˆ×	Ñ	˜HÓ	%€ð Ð^ð*Ð &ô
M[Ð%ô M[ð` 4Ð5EÐ
F�r^   