+
    œ°³j~1  ã                   ó^  € R t ^ RIHt ^RIHt ^RIHt ^RIHtH	t	 ]! RR7      ] ! R R]4      4       4       t
]! RR7      ] ! R	 R
]4      4       4       t]! RR7      ] ! R R]4      4       4       t]! RR7      ] ! R R]4      4       4       t]! RR7      ] ! R R]4      4       4       t. ROtR# )zSAM2 model configuration)Ústrict)ÚPreTrainedConfig)Úauto_docstring)ÚCONFIG_MAPPINGÚ
AutoConfigzfacebook/sam2.1-hiera-tiny)Ú
checkpointc                   ó–   a a€ ] tR t^t oRtRtRt^`t^t^t	Rt
RtRtRtRtRt^tRtRtRtRtRtRtRtRtRtV 3R	 ltV3R
 ltRtVtV ;t# )ÚSam2HieraDetConfigaÐ  
patch_kernel_size (`list[int]`, *optional*, defaults to `[7, 7]`):
    The kernel size of the patch.
patch_stride (`list[int]`, *optional*, defaults to `[4, 4]`):
    The stride of the patch.
patch_padding (`list[int]`, *optional*, defaults to `[3, 3]`):
    The padding of the patch.
query_stride (`list[int]`, *optional*, defaults to `[2, 2]`):
    The downsample stride between stages.
window_positional_embedding_background_size (`list[int]`, *optional*, defaults to `[7, 7]`):
    The window size per stage when not using global attention.
num_query_pool_stages (`int`, *optional*, defaults to 3):
    The number of query pool stages.
blocks_per_stage (`list[int]`, *optional*, defaults to `[1, 2, 7, 2]`):
    The number of blocks per stage.
embed_dim_per_stage (`list[int]`, *optional*, defaults to `[96, 192, 384, 768]`):
    The embedding dimension per stage.
num_attention_heads_per_stage (`list[int]`, *optional*, defaults to `[1, 2, 4, 8]`):
    The number of attention heads per stage.
window_size_per_stage (`list[int]`, *optional*, defaults to `[8, 4, 14, 7]`):
    The window size per stage.
global_attention_blocks (`list[int]`, *optional*, defaults to `[5, 7, 9]`):
    The blocks where global attention is used.
Úbackbone_configÚsam2_hiera_det_modelNg      @Úgeluç�íµ ÷Æ°>ç{®Gáz”?c                ó*  <€ V P                   e   V P                   MRR.V n         V P                  e   V P                  M^^.V n        V P                  e   V P                  M^^.V n        V P                  e   V P                  M^^.V n        V P                  e   V P                  M^^.V n        V P
                  e   V P
                  M^^.V n        V P                  e   V P                  M. ROV n        V P                  e   V P                  M. ROV n        V P                  e   V P                  M. ROV n        V P                  e   V P                  M. ROV n	        V P                  e   V P                  M. ROV n
        \        SV `0  ! R/ VB  R # )Né   )é   é   é   r   )é`   éÀ   é€  é   )r   r   é   é   )r   r   é   r   )é   r   é	   © )Ú
image_sizeÚpatch_kernel_sizeÚpatch_strideÚpatch_paddingÚquery_strideÚ+window_positional_embedding_background_sizeÚblocks_per_stageÚembed_dim_per_stageÚnum_attention_heads_per_stageÚwindow_size_per_stageÚglobal_attention_blocksÚsuperÚ__post_init__©ÚselfÚkwargsÚ	__class__s   &,€Úl/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/sam2/configuration_sam2.pyr*   Ú Sam2HieraDetConfig.__post_init__J   s€  ø€ Ø-1¯_©_Ò-H˜$Ÿ/š/ÈtÐUYÈlˆŒØ;?×;QÑ;QÒ;] ×!7Ò!7ÐdeÐghÐciˆÔØ15×1BÑ1BÒ1N˜D×-Ò-ÐUVÐXYÐTZˆÔØ37×3EÑ3EÒ3Q˜T×/Ò/ÐXYÐ[\ÐW]ˆÔØ15×1BÑ1BÒ1N˜D×-Ò-ÐUVÐXYÐTZˆÔð ×?Ñ?ÒKð ×<Ò<à�Q�ð 	Ô8ð
 :>×9NÑ9NÒ9Z × 5Ò 5Ò`lˆÔà(,×(@Ñ(@Ò(LˆD×$Ò$ÒReð 	Ô ð 37×2TÑ2TÒ2`ˆD×.Ò.Òfrð 	Ô*ð +/×*DÑ*DÒ*PˆD×&Ò&ÒVcð 	Ô"ð -1×,HÑ,HÒ,TˆD×(Ò(ÒZcð 	Ô$ô 	‰ÒÑ' Ô'ó    c                ó˜  <€ V ^8„  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[ S[S[ ,          ,          R,          ;R&   S[ S[S[ ,          ,          R,          ;R&   S[ S[S[ ,          ,          R,          ;R&   S[ S[S[ ,          ,          R,          ;R&   S[ S[S[ ,          ,          R,          ;R	&   S[S[ ,          R,          ;R
&   S[ ;R&   S[S[ ,          R,          ;R&   S[S[ ,          R,          ;R&   S[S[ ,          R,          ;R&   S[S[ ,          R,          ;R&   S[S[ ,          R,          ;R&   S[;R&   S[;R&   S[;R&   S[;R&   # )r   Úhidden_sizeÚnum_attention_headsÚnum_channelsNr   r   r    r!   r"   r#   Únum_query_pool_stagesr$   r%   r&   r'   r(   Ú	mlp_ratioÚ
hidden_actÚlayer_norm_epsÚinitializer_range)ÚintÚlistÚfloatÚstr)ÚformatÚ__classdict__s   "€r/   Ú__annotate__ÚSam2HieraDetConfig.__annotate__   s—  ø‡ ‚ ñ> Ññ? ñ@ Ñ ñA ñB ÑñC ñD ‘d™3•i• $Õ&Ñ-ñE ñF ™T¡#�Y•¨Õ-Ñ4ñG ñH ™™S�	•/ DÕ(Ñ/ñI ñJ ™™c�•? TÕ)Ñ0ñK ñL ™™S�	•/ DÕ(Ñ/ñM ñN 26±cµ¸TÕ1AÑHñO ñP Ñ"ñQ ñR ™3•i $Õ&Ñ-ñS ñT ™c� TÕ)Ñ0ñU ñV $(©¥9¨tÕ#3Ñ:ñW ñX  ¡�9 tÕ+Ñ2ñY ñZ "¡#�Y¨Õ-Ñ4ñ[ ñ\ Ññ] ñ^ Ññ_ ñ` Ñ ña ñb Ñ#òc r1   )r$   r%   r(   r   r&   r   r!   r    r"   r#   r'   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úbase_config_keyÚ
model_typer3   r4   r5   r   r   r    r!   r"   r#   r6   r$   r%   r&   r'   r(   r7   r8   r9   r:   r*   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__Ú__classcell__©r.   r@   s   @@r/   r	   r	      sŒ   ù‡ € ñð2 (€OØ'€Jà€KØ ÐØ€LØ)-€JØ04ÐØ+/€LØ,0€MØ+/€LØDHÐ/Ø!"ÐØ)-ÐØ,0ÐØ6:Ð!Ø.2ÐØ04ÐØ€IØ€JØ €NØ#Ðõ(÷g … r1   r	   c                   ó‚   a a€ ] tR t^et oRtRtRtR]/tRt	Rt
RtRt^t^t^ tRt^tRtRtR	tV 3R
 ltV3R ltRtVtV ;t# )ÚSam2VisionConfiga›  
backbone_channel_list (`List[int]`, *optional*, defaults to `[768, 384, 192, 96]`):
    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Úsam2_vision_modelr
   Né   r   r   r   c                ó<  <€ V P                   f   . ROMV P                   V n         V P                  f   RR.^€^€.^@^@..MV P                  V n        V P                  f   ^^.MV P                  V n        \        V P                  \
        4      '       d^   V P                  P                  RR4      V P                  R&   \        V P                  R,          ,          ! R/ V P                  B V n        MV P                  f   \        4       V n        \        SV `(  ! R/ VB  R # )NrS   rI   r   )r   r   r   r   r   )Úbackbone_channel_listÚbackbone_feature_sizesÚfpn_top_down_levelsÚ
isinstancer
   ÚdictÚgetr   r	   r)   r*   r+   s   &,€r/   r*   ÚSam2VisionConfig.__post_init__Ž   sý   ø€ à#'×#=Ñ#=Ò#EÓÈ4×KeÑKeð 	Ô"ð 37×2MÑ2MÒ2Uˆc�3ˆZ˜#˜s˜ b¨" XÑ.Ð[_×[vÑ[vð 	Ô#ð .2×-EÑ-EÒ-M A q¡6ÐSW×SkÑSkˆÔ ä�d×*Ñ*¬D×1Ò1Ø15×1EÑ1E×1IÑ1IÈ,ÐXnÓ1oˆD× Ñ  Ñ.Ü#1°$×2FÑ2FÀ|Õ2TÖ#UÑ#mÐX\×XlÑXlÑ#mˆDÕ Ø×!Ñ!Ò)Ü#5Ó#7ˆDÔ ä‰ÒÑ' Ô'r1   c                ó  <€ V ^8„  d   Qh/ S[ S[,          R,          ;R&   S[S[,          R,          ;R&   S[R,          ;R&   S[;R&   S[;R&   S[;R&   S[;R&   S[S[,          R,          ;R	&   S[;R
&   S[;R&   S[;R&   S[;R&   # )r   Nr
   rU   rV   Úfpn_hidden_sizeÚfpn_kernel_sizeÚ
fpn_strideÚfpn_paddingrW   Únum_feature_levelsr8   r9   r:   )rY   r   r<   r;   r>   r=   )r?   r@   s   "€r/   rA   ÚSam2VisionConfig.__annotate__e   sÒ   ø‡ ‚ ñ8 Ñ,Õ,¨tÕ3Ñ:ñ9 ñ:  ¡�9 tÕ+Ñ2ñ; ñ< ! 4�KÑ.ñ= ñ> Ññ? ñ@ ÑñA ñB ÑñC ñD ÑñE ñF ™c� TÕ)Ñ0ñG ñH ÑñI ñJ ÑñK ñL Ñ ñM ñN Ñ#òO r1   )rU   r
   rV   rW   )rC   rD   rE   rF   rG   rH   rI   r   Úsub_configsr
   rU   rV   r]   r^   r_   r`   rW   ra   r8   r9   r:   r*   rJ   rK   rL   rM   rN   s   @@r/   rP   rP   e   sr   ù‡ € ñð& &€OØ$€Jà˜:ð€Kð 7;€OØ.2ÐØ*.ÐØ€OØ€OØ€JØ€KØ,0ÐØÐØ€JØ €NØ#Ðõ(÷S … r1   rP   c                   óT   a € ] tR t^ t o RtRtRtRt^t^t	^t
RtRt^tV 3R ltRtV tR	# )
ÚSam2PromptEncoderConfiga=  
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_configrS   r   r   r   c                ó  <€ V ^8„  d   Qh/ S[ ;R&   S[ S[S[ ,          ,          S[S[ S[ 3,          ,          ;R&   S[ S[S[ ,          ,          S[S[ S[ 3,          ,          ;R&   S[ ;R&   S[ ;R&   S[;R&   S[;R&   S[ ;R&   # )	r   r3   r   Ú
patch_sizeÚmask_input_channelsÚnum_point_embeddingsr8   r9   Úscale)r;   r<   Útupler>   r=   )r?   r@   s   "€r/   rA   Ú$Sam2PromptEncoderConfig.__annotate__    s–   ø‡ ‚ ñ Ññ ñ ‘d™3•i•¡%©©S¨¥/Õ1Ñ8ñ ñ  ‘d™3•i•¡%©©S¨¥/Õ1Ñ6ñ! ñ" Ñ!ñ# ñ$ Ñ!ñ% ñ& Ññ' ñ( Ñ ñ) ñ* �Nò+ r1   r   N)rC   rD   rE   rF   rG   rH   r3   r   rh   ri   rj   r8   r9   rk   rJ   rK   rL   ©r@   s   @r/   re   re       sB   ø‡ € ñð .€Oà€KØ48€JØ46€JØ!ÐØ !ÐØ€JØ €NØ€E÷+ ƒ r1   re   c                   ód   a € ] tR t^¸t o RtRtRtRtRt^t	^t
^t^t^tRtRtRtRtV 3R	 ltR
tV tR# )ÚSam2MaskDecoderConfigam  
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_configrS   r   i   Tgš™™™™™©?g\�Âõ(\ï?c                óª   <€ V ^8„  d   Qh/ S[ ;R&   S[;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R	&   S[;R
&   S[;R&   S[;R&   # )r   r3   r8   Úmlp_dimÚnum_hidden_layersr4   Úattention_downsample_rateÚnum_multimask_outputsÚiou_head_depthÚiou_head_hidden_dimÚdynamic_multimask_via_stabilityÚ!dynamic_multimask_stability_deltaÚ"dynamic_multimask_stability_thresh)r;   r>   Úboolr=   )r?   r@   s   "€r/   rA   Ú"Sam2MaskDecoderConfig.__annotate__¸   s©   ø‡ ‚ ñ0 Ññ1 ñ2 Ññ3 ñ4 Ññ5 ñ6 Ññ7 ñ8 Ñ ñ9 ñ:  #Ñ&ñ; ñ< Ñ"ñ= ñ> Ññ? ñ@ Ñ"ñA ñB &*Ñ0ñC ñD (-Ñ3ñE ñF ).Ñ4òG r1   r   N)rC   rD   rE   rF   rG   rH   r3   r8   rs   rt   r4   ru   rv   rw   rx   ry   rz   r{   rJ   rK   rL   rn   s   @r/   rp   rp   ¸   s]   ø‡ € ñð& ,€Oà€KØ€JØ€GØÐØ ÐØ%&ÐØ!"ÐØ€NØ"ÐØ,0Ð#Ø/3Ð%Ø04Ð&÷G ƒ r1   rp   c                   óf   a a€ ] tR t^Þt oRtRtR]R]R]/t	Rt
RtRtRtV 3R ltV3R	 ltR
tVtV ;t# )Ú
Sam2Configa  
prompt_encoder_config (Union[`dict`, `Sam2PromptEncoderConfig`], *optional*):
    Dictionary of configuration options used to initialize [`Sam2PromptEncoderConfig`].
mask_decoder_config (Union[`dict`, `Sam2MaskDecoderConfig`], *optional*):
    Dictionary of configuration options used to initialize [`Sam2MaskDecoderConfig`].

Example:

```python
>>> from transformers import (
...     Sam2VisionConfig,
...     Sam2PromptEncoderConfig,
...     Sam2MaskDecoderConfig,
...     Sam2Model,
... )

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

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

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

>>> # We can also initialize a Sam2Config from a Sam2VisionConfig, Sam2PromptEncoderConfig, and Sam2MaskDecoderConfig

>>> # Initializing SAM2 vision encoder, memory attention, and memory encoder configurations
>>> vision_config = Sam2VisionConfig()
>>> prompt_encoder_config = Sam2PromptEncoderConfig()
>>> mask_decoder_config = Sam2MaskDecoderConfig()

>>> config = Sam2Config(vision_config, prompt_encoder_config, mask_decoder_config)
```Úsam2rQ   rf   rq   Nr   c                óÌ  <€ \        V P                  \        4      '       d^   V P                  P                  R R4      V P                  R &   \        V P                  R ,          ,          ! R/ V P                  B V n        M%V P                  f   \        R,          ! 4       V n        \        V P
                  \        4      '       d   \        R/ V P
                  B V n        MV P
                  f   \        4       V n        \        V P                  \        4      '       d   \        R/ V P                  B V n        MV P                  f   \        4       V n        \        SV `(  ! R/ VB  R# )rI   rR   Nr   )rX   rQ   rY   rZ   r   rf   re   rq   rp   r)   r*   r+   s   &,€r/   r*   ÚSam2Config.__post_init__  s  ø€ Ü�d×(Ñ(¬$×/Ò/Ø/3×/AÑ/A×/EÑ/EÀlÐTgÓ/hˆD×Ñ˜|Ñ,Ü!/°×0BÑ0BÀ<Õ0PÖ!QÑ!gÐTX×TfÑTfÑ!gˆDÕØ×ÑÒ'Ü!/Ð0CÖ!DÓ!FˆDÔä�d×0Ñ0´$×7Ò7Ü)@Ñ)^À4×C]ÑC]Ñ)^ˆDÕ&Ø×'Ñ'Ò/Ü)@Ó)BˆDÔ&ä�d×.Ñ.´×5Ò5Ü'<Ñ'X¸t×?WÑ?WÑ'XˆDÕ$Ø×%Ñ%Ò-Ü'<Ó'>ˆDÔ$ä‰ÒÑ' Ô'r1   c                ó¤   <€ V ^8„  d   Qh/ S[ S[,          R,          ;R&   S[ S[,          R,          ;R&   S[ S[,          R,          ;R&   S[;R&   # )r   NrQ   rf   rq   r:   )rY   r   r=   )r?   r@   s   "€r/   rA   ÚSam2Config.__annotate__Þ   sb   ø‡ ‚ ñZ Ñ*Õ*¨TÕ1Ñ8ñ[ ñ\  Ñ"2Õ2°TÕ9Ñ@ñ] ñ^ Ñ 0Õ0°4Õ7Ñ>ñ_ ñ` Ñ#òa r1   )rq   rf   rQ   )rC   rD   rE   rF   rG   rI   r   re   rp   rc   rQ   rf   rq   r:   r*   rJ   rK   rL   rM   rN   s   @@r/   r   r   Þ   sP   ù‡ € ñ!ðF €Jà˜ØÐ!8ØÐ4ð€Kð 59€MØ<@ÐØ:>ÐØ#Ðõ(÷e … r1   r   N)r   r	   rP   re   rp   )rG   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   Úautor   r   r	   rP   re   rp   r   Ú__all__r   r1   r/   Ú<module>rŠ      sù   ðñ å .å 3Ý #ß -ñ Ð7Ô8ØôI(Ð)ó I(ó ó 9ðI(ñX Ð7Ô8Øô6(Ð'ó 6(ó ó 9ð6(ñr Ð7Ô8ØôÐ.ó ó ó 9ðñ, Ð7Ô8Øô!5Ð,ó !5ó ó 9ð!5ñH Ð7Ô8ØôA(Ð!ó A(ó ó 9ðA(òH‚r1   