
    Z jO                     |    S 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
  \" S	S
9\ " S S\5      5       5       rS/rg)zDPT model configuration    )strict   )%consolidate_backbone_kwargs_to_config)PreTrainedConfig)auto_docstring   )
AutoConfigzIntel/dpt-large)
checkpointc                   *  ^  \ rS rSr% SrSrS\0rSr\	\
S'   SrS\	-  \
S	'   Sr\	S-  \
S
'   Sr\	S-  \
S'   Sr\\
S'   Sr\\	-  S-  \
S'   Sr\\	-  S-  \
S'   Sr\\
S'   Sr\S-  \
S'   Sr\	\\	   -  \\	\	4   -  S-  \
S'   Sr\	\\	   -  \\	\	4   -  S-  \
S'   Sr\	S-  \
S'   Sr\\
S'   Sr\S-  \
S'   S r\\	   \\	S!4   -  S-  \
S"'   S#r\\
S$'   S%r\\	\-     \\	\-  S!4   -  \
S&'   S'r \\	   \\	S!4   -  \
S('   S)r!\	\
S*'   S+r"\	\
S,'   Sr#\S-  \
S-'   Sr$\S-  \
S.'   Sr%\\
S/'   Sr&\S-  \
S0'   S1r'\\
S2'   S3r(\	\
S4'   S5r)\\	-  \
S6'   S7r*\\	   \\	S!4   -  S-  \
S8'   S9r+\\	   \\	S!4   -  \
S:'   Sr,\-\.-  S-  \
S'   Sr/\	S-  \
S;'   S<r0\\
S='   U 4S> jr1S?r2U =r3$ )@	DPTConfig   a8  
is_hybrid (`bool`, *optional*, defaults to `False`):
    Whether to use a hybrid backbone. Useful in the context of loading DPT-Hybrid models.
backbone_out_indices (`list[int]`, *optional*, defaults to `[2, 5, 8, 11]`):
    Indices of the intermediate hidden states to use from backbone.
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.
add_projection (`bool`, *optional*, defaults to `False`):
    Whether to add a projection layer before the depth estimation head.
use_auxiliary_head (`bool`, *optional*, defaults to `True`):
    Whether to use an auxiliary head during training.
auxiliary_loss_weight (`float`, *optional*, defaults to 0.4):
    Weight of the cross-entropy loss of the auxiliary head.
semantic_classifier_dropout (`float`, *optional*, defaults to 0.1):
    The dropout ratio for the semantic classification head.
backbone_featmap_shape (`list[int]`, *optional*, defaults to `[1, 1024, 24, 24]`):
    Used only for the `hybrid` embedding type. The shape of the feature maps of the backbone.
neck_ignore_stages (`list[int]`, *optional*, defaults to `[0, 1]`):
    Used only for the `hybrid` embedding type. The stages of the readout layers to ignore.
pooler_output_size (`int`, *optional*):
    Dimensionality of the pooler layer. If None, defaults to `hidden_size`.
pooler_act (`str`, *optional*, defaults to `"tanh"`):
    The activation function to be used by the pooler.

Example:

```python
>>> from transformers import DPTModel, DPTConfig

>>> # Initializing a DPT dpt-large style configuration
>>> configuration = DPTConfig()

>>> # Initializing a model from the dpt-large style configuration
>>> model = DPTModel(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
```dptbackbone_config   hidden_size   Nnum_hidden_layersnum_attention_headsi   intermediate_sizegelu
hidden_actg        hidden_dropout_probattention_probs_dropout_probg{Gz?initializer_rangeg-q=layer_norm_eps  
image_size   
patch_sizer   num_channelsF	is_hybridTqkv_bias)r            .backbone_out_indicesprojectreadout_type)   r      g      ?reassemble_factors)`      r   r   neck_hidden_sizes   fusion_hidden_sizehead_in_index!use_batch_norm_in_fusion_residualuse_bias_in_fusion_residualadd_projectionuse_auxiliary_headg?auxiliary_loss_weight   semantic_loss_ignore_indexg?semantic_classifier_dropout)r*   i   r   r   backbone_featmap_shape)r   r*   neck_ignore_stagespooler_output_sizetanh
pooler_actc                   > U R                   S;  a  [        S5      eU R                  (       a  [        U R                  [
        5      (       a  U R                  R                  SS5        [        SU R                  SSS/ SQ/ SQS	S
.S.UD6u  U l        nU R                   S:w  a  [        S5      eOEUR                  S5      c  U R                  b&  [        SSU R                  0UD6u  U l        nS U l	        U R                  (       a  U R                  OS U l
        U R                  (       a  U R                  O/ U l        U R                  (       a  U R                  OU R                  U l        [        TU ]<  " S0 UD6  g )N)ignoreaddr'   z8Readout_type must be one of ['ignore', 'add', 'project']
model_typebitsame
bottleneck)r   r)   	   )stage1stage2stage3T)global_padding
layer_typedepthsout_featuresembedding_dynamic_padding)r   default_config_typedefault_config_kwargsr'   z<Readout type must be 'project' when using `DPT-hybrid` mode.backboner    )r(   
ValueErrorr!   
isinstancer   dict
setdefaultr   getr&   r;   r<   r=   r   super__post_init__)selfkwargs	__class__s     z/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/transformers/models/dpt/configuration_dpt.pyrZ   DPTConfig.__post_init__{   sY   $@@WXX>>$..55$$//eD+P , $ 4 4$)&,".'$B15', ,(D &   I- !_`` .ZZ
#/43G3G3S+P , $ 4 4,,(D & )-D%EI^^d&A&AY]#=A^^$"9"9QS=A=T=T$"9"9Z^ZjZj''    )r   r;   r&   r<   r=   )4__name__
__module____qualname____firstlineno____doc__rC   r	   sub_configsr   int__annotations__r   r   r   r   strr   floatr   r   r   r   listtupler   r    r!   boolr"   r&   r(   r+   r.   r0   r2   r3   r4   r5   r6   r7   r9   r:   r;   r<   r   rV   r   r=   r?   rZ   __static_attributes____classcell__)r]   s   @r^   r   r      s`   7r J$j1K
 K$&tcz&&(t($(sTz(J.1t+17: %#+"4:#u##(NEDL(;>Jd3i%S/1D8>;=Jd3i%S/1D8= L#* It HdTk ?L$s)eCHo5<L!L#!FTS5[)E#+s2B,CCT5HtCy5c?2H!!M35:%td{:/33 ND &*t*#&5&&))/22ARDIc3h7$>R6<S	E#s(O3<6:OT,,t3:%)d
)J (  (r`   r   N)re   huggingface_hub.dataclassesr   backbone_utilsr   configuration_utilsr   utilsr   auto.configuration_autor	   r   __all__rS   r`   r^   <module>rv      sP     . C 3 # 0 ,-A(  A(  .A(H -r`   