
    i                         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	 ddl
mZ  e	d	
      e G d de                    ZdgZy)    )Literal)strict   )%consolidate_backbone_kwargs_to_config)PreTrainedConfig)auto_docstring   )
AutoConfigz%facebook/dinov3-vitl16-chmv2-dpt-head)
checkpointc                       e Zd ZU dZdZdeiZdZee	z  dz  e
d<   dZee
d<   dZee
d<   dZeeez     dz  e
d	<   dZee   dz  e
d
<   dZee
d<   dZee
d<   dZee
d<   dZee
d<   dZee
d<   dZee
d<   dZed   e
d<   dZed   e
d<    fdZ xZS )CHMv2Configa  
    backbone_config (`Union[dict, "PreTrainedConfig"]`, *optional*):
        The configuration of the backbone model. Only DINOv3ViTConfig is currently supported.
    patch_size (`int`, *optional*, defaults to 16):
        The patch size used by the backbone vision transformer.
    reassemble_factors (`list[float]`, *optional*, defaults to `[4, 2, 1, 0.5]`):
        The up/downsampling factors of the reassemble layers.
    post_process_channels (`list[int]`, *optional*, defaults to `[128, 256, 512, 1024]`):
        The output channel sizes of the reassemble stage for each backbone feature level.
    fusion_hidden_size (`int`, *optional*, defaults to 256):
        The number of channels before fusion.
    head_hidden_size (`int`, *optional*, defaults to 128):
        The number of channels in the hidden layer of the depth estimation head.
    number_output_channels (`int`, *optional*, defaults to 256):
        Number of output channels for the CHMv2 head (number of depth bins).
    readout_type (`str`, *optional*, defaults to `"project"`):
        Type of readout operation for the CLS token. One of `["ignore", "add", "project"]`.
    min_depth (`float`, *optional*, defaults to 0.001):
        The minimum depth value for depth bin calculation.
    max_depth (`float`, *optional*, defaults to 96.0):
        The maximum depth value for depth bin calculation.
    bins_strategy (`str`, *optional*, defaults to `"chmv2_mixlog"`):
        The strategy for depth bins distribution. One of `["linear", "log", "chmv2_mixlog"]`.
    norm_strategy (`str`, *optional*, defaults to `"chmv2_mixlog"`):
        The normalization strategy for depth prediction. One of `["linear", "softmax", "sigmoid", "chmv2_mixlog"]`.

    ```python
    >>> from transformers import CHMv2Config, CHMv2ForDepthEstimation

    >>> configuration = CHMv2Config()
    >>> model = CHMv2ForDepthEstimation(configuration)
    >>> configuration = model.config
    ```
    chmv2backbone_configN   
patch_sizeg{Gz?initializer_rangereassemble_factorspost_process_channels   fusion_hidden_size   head_hidden_sizenumber_output_channelsprojectreadout_typegMbP?	min_depthg      X@	max_depthchmv2_mixlog)linearlogr   bins_strategy)r   softmaxsigmoidr   norm_strategyc                     | j                   	g d| _         | j                  	g d| _        ddddddd	g d
d	d	dd	d}t        d| j                  d|d|\  | _        }t	        |   di | y )N)   r	      g      ?)r   r   i      i  r(   i   r      r&   T)         r)   gư>)
image_sizehidden_sizeintermediate_sizenum_attention_headsnum_hidden_layersnum_register_tokenskey_biasout_indicesreshape_hidden_statesapply_layernormlayer_norm_epsreturn_class_token
dinov3_vit)r   default_config_typedefault_config_kwargs )r   r   r   r   super__post_init__)selfkwargsr;   	__class__s      ~/var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/transformers/models/chmv2/configuration_chmv2.pyr>   zCHMv2Config.__post_init__V   s    ""*&4D#%%-)>D& !%#%!##$*%)#""&!
 (M (
 00 ,"7(
 	(
$f 	''    )__name__
__module____qualname____doc__
model_typer
   sub_configsr   dictr   __annotations__r   intr   floatr   listr   r   r   r   r   strr   r   r!   r   r$   r>   __classcell__)rA   s   @rB   r   r      s    !F J$j1K6:OT,,t3:J#u#37US[)D07.249t+2!!c"%C%!L#!IuIu>LM7:;LM[M7IJ[( (rC   r   N)typingr   huggingface_hub.dataclassesr   backbone_utilsr   configuration_utilsr   utilsr   autor
   r   __all__r<   rC   rB   <module>rX      sQ   *  . C 3 #  BCQ(" Q(  DQ(h /rC   