
    Z jv&                        S SK Jr  SSKJr  SSKJr  SSKJrJr  \" SS9\ " S	 S
\5      5       5       r	\" SS9\ " S S\5      5       5       r
\" SS9\ " S S\5      5       5       r\" SS9\ " S S\5      5       5       r/ SQrg)    )strict   )PreTrainedConfig)auto_docstring   )CONFIG_MAPPING
AutoConfigzyonigozlan/EdgeTAM-hf)
checkpointc                     ^  \ rS rSr% SrSrSrS\0rSr	\
\-  S-  \S'   Sr\\   S-  \S'   Sr\S-  \S'   S	r\\S
'   Sr\\S'   Sr\\S'   Sr\\S'   Sr\\   S-  \S'   Sr\\S'   Sr\\S'   Sr\\S'   Sr\\S'   U 4S jrSrU =r$ )EdgeTamVisionConfig   a  
backbone_channel_list (`List[int]`, *optional*, defaults to `[384, 192, 96, 48]`):
    The list of channel dimensions for the backbone.
backbone_feature_sizes (`List[List[int]]`, *optional*, defaults to `[[256, 256], [128, 128], [64, 64]]`):
    The spatial sizes of the feature maps from the backbone.
fpn_hidden_size (`int`, *optional*, defaults to 256):
    The hidden dimension of the FPN.
fpn_kernel_size (`int`, *optional*, defaults to 1):
    The kernel size for the convolutions in the neck.
fpn_stride (`int`, *optional*, defaults to 1):
    The stride for the convolutions in the neck.
fpn_padding (`int`, *optional*, defaults to 0):
    The padding for the convolutions in the neck.
fpn_top_down_levels (`List[int]`, *optional*, defaults to `[2, 3]`):
    The levels for the top-down FPN connections.
num_feature_levels (`int`, *optional*, defaults to 3):
    The number of feature levels from the FPN to use.
vision_configedgetam_vision_modelbackbone_configNbackbone_channel_listbackbone_feature_sizes   fpn_hidden_size   fpn_kernel_size
fpn_strider   fpn_paddingfpn_top_down_levelsr   num_feature_levelsgelu
hidden_actư>layer_norm_eps{Gz?initializer_rangec                 B  > U R                   c  / SQOU R                   U l         U R                  c  SS/SS/SS//OU R                  U l        U R                  c  SS/OU R                  U l        [        U R                  [
        5      (       aU  U R                  R                  SS5      U R                  S'   [        U R                  S      " S0 U R                  D6U l        O-U R                  c   [        R                  " S	SS
/ SQS.S9U l        [        TU ],  " S0 UD6  g )N)i     `   0   r      @   r   r   
model_typetimm_wrapperztimm/repvit_m1.dist_in1kT)r   r   r   r   )in_chansfeatures_onlyout_indices)
model_args )r   r   r   
isinstancer   dictgetr   r	   from_pretrainedsuper__post_init__selfkwargs	__class__s     ڂ/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/transformers/models/edgetam/configuration_edgetam.pyr3   !EdgeTamVisionConfig.__post_init__D   s   "&"<"<"D$JdJd 	" 372M2M2Uc3Z#sb"X.[_[v[v 	# .2-E-E-MAq6SWSkSk d**D11151E1E1I1I,Xf1gD  .#1$2F2F|2T#U#mX\XlXl#mD !!)#-#=#=*()DQ]^$D  	''    )r   r   r   r   )__name__
__module____qualname____firstlineno____doc__base_config_keyr'   r	   sub_configsr   r/   r   __annotations__r   listintr   r   r   r   r   r   r   r   strr   floatr    r3   __static_attributes____classcell__r7   s   @r8   r   r      s    & &O'J:K 7;OT,,t3:.249t+2*.D4K.OSOSJK,0cT)0J NE #u#( (r:   r   c                       \ rS rSr% SrSrSr\\S'   Sr	\\
\   -  \\\4   -  \S'   Sr\\
\   -  \\\4   -  \S	'   Sr\\S
'   Sr\\S'   Sr\\S'   Sr\\S'   Sr\\S'   Srg)EdgeTamPromptEncoderConfigX   a=  
mask_input_channels (`int`, *optional*, defaults to 16):
    The number of channels to be fed to the `MaskDecoder` module.
num_point_embeddings (`int`, *optional*, defaults to 4):
    The number of point embeddings to be used.
scale (`float`, *optional*, defaults to 1):
    The scale factor for the prompt encoder.
prompt_encoder_configr   hidden_sizei   
image_size   
patch_sizemask_input_channels   num_point_embeddingsr   r   r   r   r   scaler-   N)r;   r<   r=   r>   r?   r@   rN   rD   rB   rO   rC   tuplerQ   rR   rT   r   rE   r   rF   rU   rG   r-   r:   r8   rK   rK   X   s     .OK48Jd3i%S/1846Jd3i%S/16!! !#!J NE E3Nr:   rK   c                       \ rS rSr% SrSrSr\\S'   Sr	\
\S'   Sr\\S	'   S
r\\S'   Sr\\S'   S
r\\S'   Sr\\S'   Sr\\S'   Sr\\S'   Sr\\S'   Sr\\S'   Sr\\S'   Srg)EdgeTamMaskDecoderConfigp   am  
mlp_dim (`int`, *optional*, defaults to 2048):
    The dimension of the MLP in the two-way transformer.
attention_downsample_rate (`int`, *optional*, defaults to 2):
    The downsample rate for the attention layers.
num_multimask_outputs (`int`, *optional*, defaults to 3):
    The number of multimask outputs.
iou_head_depth (`int`, *optional*, defaults to 3):
    The depth of the IoU head.
iou_head_hidden_dim (`int`, *optional*, defaults to 256):
    The hidden dimension of the IoU head.
dynamic_multimask_via_stability (`bool`, *optional*, defaults to `True`):
    Whether to use dynamic multimask via stability.
dynamic_multimask_stability_delta (`float`, *optional*, defaults to 0.05):
    The stability delta for the dynamic multimask.
dynamic_multimask_stability_thresh (`float`, *optional*, defaults to 0.98):
    The stability threshold for the dynamic multimask.
mask_decoder_configr   rN   r   r   i   mlp_dimr   num_hidden_layers   num_attention_headsattention_downsample_rater   num_multimask_outputsiou_head_depthiou_head_hidden_dimTdynamic_multimask_via_stabilityg?!dynamic_multimask_stability_deltag\(\?"dynamic_multimask_stability_threshr-   N)r;   r<   r=   r>   r?   r@   rN   rD   rB   r   rE   r[   r\   r^   r_   r`   ra   rb   rc   boolrd   rF   re   rG   r-   r:   r8   rX   rX   p   s    & ,OKJGSs  %&s&!"3"NC"",0#T0/3%u304&4r:   rX   c                      ^  \ rS rSr% SrSr\\\S.r	Sr
\\-  S-  \S'   Sr\\-  S-  \S'   Sr\\-  S-  \S'   S	r\\S
'   U 4S jrSrU =r$ )EdgeTamConfig   a]  
prompt_encoder_config (Union[`dict`, `EdgeTamPromptEncoderConfig`], *optional*):
    Dictionary of configuration options used to initialize [`EdgeTamPromptEncoderConfig`].
mask_decoder_config (Union[`dict`, `EdgeTamMaskDecoderConfig`], *optional*):
    Dictionary of configuration options used to initialize [`EdgeTamMaskDecoderConfig`].

 Example:

 ```python
 >>> from transformers import (
 ...     EdgeTamVisionConfig,
 ...     EdgeTamPromptEncoderConfig,
 ...     EdgeTamMaskDecoderConfig,
 ...     EdgeTamModel,
 ... )

 >>> # Initializing a EdgeTamConfig with `"facebook/edgetam.1_hiera_tiny"` style configuration
 >>> configuration = EdgeTamConfig()

 >>> # Initializing a EdgeTamModel (with random weights) from the `"facebook/edgetam.1_hiera_tiny"` style configuration
 >>> model = EdgeTamModel(configuration)

 >>> # Accessing the model configuration
 >>> configuration = model.config

 >>> # We can also initialize a EdgeTamConfig from a EdgeTamVisionConfig, EdgeTamPromptEncoderConfig, and EdgeTamMaskDecoderConfig
 >>> # Initializing EDGETAM vision encoder, memory attention, and memory encoder configurations
 >>> vision_config = EdgeTamVisionConfig()
 >>> prompt_encoder_config = EdgeTamPromptEncoderConfig()
 >>> mask_decoder_config = EdgeTamMaskDecoderConfig()

 >>> config = EdgeTamConfig(vision_config, prompt_encoder_config, mask_decoder_config)
 ```
edgetam)r   rM   rZ   Nr   rM   rZ   r   r    c                   > [        U R                  [        5      (       aU  U R                  R                  SS5      U R                  S'   [        U R                  S      " S0 U R                  D6U l        O U R                  c  [        S   " 5       U l        [        U R
                  [        5      (       a  [        S0 U R
                  D6U l        OU R
                  c  [        5       U l        [        U R                  [        5      (       a  [        S0 U R                  D6U l        OU R                  c  [        5       U l        [        TU ](  " S0 UD6  g )Nr'   r   r-   )r.   r   r/   r0   r   rM   rK   rZ   rX   r2   r3   r4   s     r8   r3   EdgeTamConfig.__post_init__   s   d(($///3/A/A/E/ElTj/kD|,!/0B0B<0P!Q!gTXTfTf!gD'!/0F!G!IDd00$77)C)adF`F`)aD&''/)C)ED&d..55'?'[$BZBZ'[D$%%-'?'AD$''r:   )rZ   rM   r   )r;   r<   r=   r>   r?   r'   r	   rK   rX   rA   r   r/   r   rB   rM   rZ   r    rF   r3   rG   rH   rI   s   @r8   rh   rh      sx    !F J#!;7K 59M4**T18<@4"22T9@:> 0047>#u#( (r:   rh   )rh   r   rK   rX   N)huggingface_hub.dataclassesr   configuration_utilsr   utilsr   autor   r	   r   rK   rX   rh   __all__r-   r:   r8   <module>rr      s   ( / 3 # - 238(* 8(  48(v 23!1   4, 23!5/ !5  4!5H 23A($ A(  4A(H mr:   