+
    œ°³j7  ã                   ó€   € ^ RI Ht ^RIHt ^RIHt ^RIHt ^RIH	t	 ]! RR7      ] ! R R	]4      4       4       t
R	.tR
# )é    )Ústrict)Ú%consolidate_backbone_kwargs_to_config)ÚPreTrainedConfig)Úauto_docstring)Ú
AutoConfigz"Intellindust/DEIMv2_HGNetv2_N_COCO)Ú
checkpointc                   ó�  a a€ ] tR t^t oRtRtR]/tRR.tRRRR	/t	R
t
RtRtRtRtRtRtR(tR)t^tRt^tRtRtR*tRtRtRtRtRtRtRtRt R+t!Rt"^t#^t$^t%^t&Rt'Rt(^dt)Rt*Rt+Rt,Rt-Rt.Rt/Rt0Rt1Rt2Rt3Rt4Rt5Rt6Rt7Rt8Rt9Rt:Rt;Rt<Rt=R,t>Rt?^ t@R tARtB^tC^@tD^tERtFR!tGRtHRtIRtJRtKRtLRtMR"tN^tOR#tPRtQRtRRtSV 3R$ ltTR% tUV3R& ltVR'tWVtXV ;tY# )-ÚDeimv2ConfigaP  
initializer_bias_prior_prob (`float`, *optional*):
    The prior probability used by the bias initializer to initialize biases for `enc_score_head` and `class_embed`.
    If `None`, `prior_prob` computed as `prior_prob = 1 / (num_labels + 1)` while initializing model weights.
freeze_backbone_batch_norms (`bool`, *optional*, defaults to `True`):
    Whether to freeze the batch normalization layers in the backbone.
encoder_in_channels (`list`, *optional*, defaults to `[512, 1024, 2048]`):
    Multi level features input for encoder.
feat_strides (`list[int]`, *optional*, defaults to `[8, 16, 32]`):
    Strides used in each feature map.
encode_proj_layers (`list[int]`, *optional*, defaults to `[2]`):
    Indexes of the projected layers to be used in the encoder.
positional_encoding_temperature (`int`, *optional*, defaults to 10000):
    The temperature parameter used to create the positional encodings.
encoder_activation_function (`str`, *optional*, defaults to `"gelu"`):
    The non-linear activation function (function or string) in the encoder and pooler.
eval_size (`list[int]` or `tuple[int, int]`, *optional*):
    Height and width used to computes the effective height and width of the position embeddings after taking
    into account the stride.
normalize_before (`bool`, *optional*, defaults to `False`):
    Determine whether to apply layer normalization in the transformer encoder layer before self-attention and
    feed-forward modules.
hidden_expansion (`float`, *optional*, defaults to 1.0):
    Expansion ratio to enlarge the dimension size of RepVGGBlock and CSPRepLayer.
num_queries (`int`, *optional*, defaults to 300):
    Number of object queries.
decoder_in_channels (`list`, *optional*, defaults to `[256, 256, 256]`):
    Multi level features dimension for decoder.
num_feature_levels (`int`, *optional*, defaults to 3):
    The number of input feature levels.
decoder_n_points (`int`, *optional*, defaults to 4):
    The number of sampled keys in each feature level for each attention head in the decoder.
decoder_activation_function (`str`, *optional*, defaults to `"relu"`):
    The non-linear activation function (function or string) in the decoder.
num_denoising (`int`, *optional*, defaults to 100):
    The total number of denoising tasks or queries to be used for contrastive denoising.
label_noise_ratio (`float`, *optional*, defaults to 0.5):
    The fraction of denoising labels to which random noise should be added.
box_noise_scale (`float`, *optional*, defaults to 1.0):
    Scale or magnitude of noise to be added to the bounding boxes.
learn_initial_query (`bool`, *optional*, defaults to `False`):
    Indicates whether the initial query embeddings for the decoder should be learned during training.
anchor_image_size (`tuple[int, int]`, *optional*):
    Height and width of the input image used during evaluation to generate the bounding box anchors.
with_box_refine (`bool`, *optional*, defaults to `True`):
    Whether to apply iterative bounding box refinement.
matcher_alpha (`float`, *optional*, defaults to 0.25):
    Parameter alpha used by the Hungarian Matcher.
matcher_gamma (`float`, *optional*, defaults to 2.0):
    Parameter gamma used by the Hungarian Matcher.
matcher_class_cost (`float`, *optional*, defaults to 2.0):
    The relative weight of the class loss used by the Hungarian Matcher.
matcher_bbox_cost (`float`, *optional*, defaults to 5.0):
    The relative weight of the bounding box loss used by the Hungarian Matcher.
matcher_giou_cost (`float`, *optional*, defaults to 2.0):
    The relative weight of the giou loss used by the Hungarian Matcher.
use_focal_loss (`bool`, *optional*, defaults to `True`):
    Parameter informing if focal loss should be used.
focal_loss_alpha (`float`, *optional*, defaults to 0.75):
    Parameter alpha used to compute the focal loss.
focal_loss_gamma (`float`, *optional*, defaults to 2.0):
    Parameter gamma used to compute the focal loss.
weight_loss_vfl (`float`, *optional*, defaults to 1.0):
    Relative weight of the varifocal loss in the object detection loss.
weight_loss_bbox (`float`, *optional*, defaults to 5.0):
    Relative weight of the L1 bounding box loss in the object detection loss.
weight_loss_giou (`float`, *optional*, defaults to 2.0):
    Relative weight of the generalized IoU loss in the object detection loss.
weight_loss_fgl (`float`, *optional*, defaults to 0.15):
    Relative weight of the fine-grained localization loss in the object detection loss.
weight_loss_ddf (`float`, *optional*, defaults to 1.5):
    Relative weight of the decoupled distillation focal loss in the object detection loss.
eval_idx (`int`, *optional*, defaults to -1):
    Index of the decoder layer to use for evaluation.
layer_scale (`float`, *optional*, defaults to `1.0`):
    Scaling factor for the hidden dimension in later decoder layers.
max_num_bins (`int`, *optional*, defaults to 32):
    Maximum number of bins for the distribution-guided bounding box refinement.
reg_scale (`float`, *optional*, defaults to 4.0):
    Scale factor for the regression distribution.
depth_mult (`float`, *optional*, defaults to 1.0):
    Multiplier for the number of blocks in RepNCSPELAN5 layers.
top_prob_values (`int`, *optional*, defaults to 4):
    Number of top probability values to consider from each corner's distribution.
lqe_hidden_dim (`int`, *optional*, defaults to 64):
    Hidden dimension size for the Location Quality Estimator (LQE) network.
lqe_layers (`int`, *optional*, defaults to 2):
    Number of layers in the Location Quality Estimator MLP.
decoder_offset_scale (`float`, *optional*, defaults to 0.5):
    Offset scale used in deformable attention.
decoder_method (`str`, *optional*, defaults to `"default"`):
    The method to use for the decoder: `"default"` or `"discrete"`.
up (`float`, *optional*, defaults to 0.5):
    Controls the upper bounds of the Weighting Function.
weight_loss_mal (`float`, *optional*, defaults to 1.0):
    Relative weight of the matching auxiliary loss in the object detection loss.
use_dense_one_to_one (`bool`, *optional*, defaults to `True`):
    Whether to use dense one-to-one matching across decoder layers.
mal_alpha (`float`, *optional*):
    Alpha parameter for the Matching Auxiliary Loss (MAL). If `None`, uses `focal_loss_alpha`.
encoder_fuse_op (`str`, *optional*, defaults to `"sum"`):
    Fusion operation used in the encoder FPN. DEIMv2 uses `"sum"` instead of D-FINE's `"cat"`.
spatial_tuning_adapter_inplanes (`int`, *optional*, defaults to 16):
    Number of input planes for the STA convolutional stem.
encoder_type (`str`, *optional*, defaults to `"hybrid"`):
    Type of encoder to use. `"hybrid"` uses the full HybridEncoder with AIFI, FPN, and PAN.
    `"lite"` uses the lightweight LiteEncoder with GAP fusion for smaller variants (Atto, Femto, Pico).
use_gateway (`bool`, *optional*, defaults to `True`):
    Whether to use the gateway mechanism (cross-attention gating) in decoder layers. When `False`,
    uses RMSNorm on the encoder attention output instead.
share_bbox_head (`bool`, *optional*, defaults to `False`):
    Whether to share the bounding box prediction head across all decoder layers.
encoder_has_trailing_conv (`bool`, *optional*, defaults to `True`):
    Whether the encoder's CSP blocks include a trailing 3x3 convolution after the bottleneck path.
    `True` for RepNCSPELAN4 (used by HGNetV2 N and LiteEncoder variants).
    `False` for RepNCSPELAN5 (used by DINOv3 variants).
Údeimv2Úbackbone_configÚbasicÚ
bottleneckÚhidden_sizeÚd_modelÚnum_attention_headsÚencoder_attention_headsg{®Gáz„?Ngñhãˆµøä>Té   é   g        i'  ÚgeluÚsiluFg      ð?i,  Úrelug      à?g      Ð?g       @g      @g      è?g333333Ã?g      ø?g-Cëâ6?g      @ÚdefaultÚsumÚhybridc                óº   <€ \        RR V P                  RRRR. RO//VB w  V n        pV P                  V P                  ,          V n        \
        SV `  ! R/ VB  R# )r   Údefault_config_typeÚhgnet_v2Údefault_config_kwargsÚout_indicesN© )é   é   é   )r   r   r   Údecoder_attention_headsÚhead_dimÚsuperÚ__post_init__)ÚselfÚkwargsÚ	__class__s   &,€Úp/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/deimv2/configuration_deimv2.pyr'   ÚDeimv2Config.__post_init__ò   sl   ø€ Ü'Lñ (
Ø ×0Ñ0ð(
à *ð(
ð $1²)Ð"<ð(
ð ñ	(
Ñ$ˆÔ˜fð Ÿ™¨×(DÑ(DÕDˆŒÜ‰ÒÑ' Ô'ó    c                óŽ  € \        V P                  \        4      '       dT   \        V P                  4      V P                  8w  d0   \        R\        V P                  4       RV P                   R24      hV P                  V P                  ,          V P                  8w  d&   \        RV P                   RV P                   24      hR# )zOPart of `@strict`-powered validation. Validates the architecture of the config.z!Length of decoder_n_points list (z!) must match num_feature_levels (z).zEmbedded dimension z. must be divisible by decoder_attention_heads N)	Ú
isinstanceÚdecoder_n_pointsÚlistÚlenÚnum_feature_levelsÚ
ValueErrorr%   r$   r   )r(   s   &r+   Úvalidate_architectureÚ"Deimv2Config.validate_architectureü   sÆ   € ä�d×+Ñ+¬T×2Ò2Ü�4×(Ñ(Ó)¨T×-DÑ-DÔDÜ Ø7¼¸D×<QÑ<QÓ8RÐ7SÐStÐuy÷  vMñ  vMð  uNð  NPð  Qóð ð �=‰=˜4×7Ñ7Õ7¸4¿<¹<ÔGÜØ% d§l¡l ^Ð3aÐbf×b~Ñb~Ðað  Aóð ñ Hr-   c                ón  <€ V ^8„  d   Qh/ S[ ;R&   S[ R,          ;R&   S[ ;R&   S[ ;R&   S[S[,          R,          ;R&   S[;R&   S[;R&   S[S[,          S[S[R	3,          ,          ;R
&   S[S[,          S[S[R	3,          ,          ;R&   S[;R&   S[;R&   S[;R&   S[ S[,          ;R&   S[ S[,          ;R&   S[S[,          S[S[R	3,          ,          ;R&   S[;R&   S[;R&   S[;R&   S[S[,          S[S[S[3,          ,          R,          ;R&   S[;R&   S[ ;R&   S[;R&   S[;R&   S[S[,          S[S[R	3,          ,          ;R&   S[;R&   S[;R&   S[S[S[,          ,          ;R&   S[;R&   S[;R&   S[;R &   S[ S[,          ;R!&   S[;R"&   S[ ;R#&   S[ ;R$&   S[;R%&   S[S[S[,          ,          R,          ;R&&   S[;R'&   S[ ;R(&   S[ ;R)&   S[ ;R*&   S[ ;R+&   S[ ;R,&   S[;R-&   S[;R.&   S[ ;R/&   S[ ;R0&   S[ ;R1&   S[ ;R2&   S[ ;R3&   S[ ;R4&   S[ ;R5&   S[ ;R6&   S[;R7&   S[S[ ,          ;R8&   S[;R9&   S[ ;R:&   S[ ;R;&   S[;R<&   S[;R=&   S[;R>&   S[ ;R?&   S[;R@&   S[ ;RA&   S[;RB&   S[;RC&   S[ ;RD&   S[;RE&   S[ R,          ;RF&   S[;RG&   S[;RH&   S[;RI&   S[;RJ&   S[;RK&   S[;RL&   # )Mr!   Úinitializer_rangeNÚinitializer_bias_prior_probÚlayer_norm_epsÚbatch_norm_epsr   Úfreeze_backbone_batch_normsÚencoder_hidden_dim.Úencoder_in_channelsÚfeat_stridesÚencoder_layersÚencoder_ffn_dimr   ÚdropoutÚactivation_dropoutÚencode_proj_layersÚpositional_encoding_temperatureÚencoder_activation_functionÚactivation_functionÚ	eval_sizeÚnormalize_beforeÚhidden_expansionr   Únum_queriesÚdecoder_in_channelsÚdecoder_ffn_dimr3   r0   Údecoder_layersr$   Údecoder_activation_functionÚattention_dropoutÚnum_denoisingÚlabel_noise_ratioÚbox_noise_scaleÚlearn_initial_queryÚanchor_image_sizeÚwith_box_refineÚmatcher_alphaÚmatcher_gammaÚmatcher_class_costÚmatcher_bbox_costÚmatcher_giou_costÚuse_focal_lossÚauxiliary_lossÚfocal_loss_alphaÚfocal_loss_gammaÚweight_loss_vflÚweight_loss_bboxÚweight_loss_giouÚweight_loss_fglÚweight_loss_ddfÚeos_coefficientÚeval_idxÚlayer_scaleÚmax_num_binsÚ	reg_scaleÚ
depth_multÚtop_prob_valuesÚlqe_hidden_dimÚ
lqe_layersÚdecoder_offset_scaleÚdecoder_methodÚupÚtie_word_embeddingsÚis_encoder_decoderÚweight_loss_malÚuse_dense_one_to_oneÚ	mal_alphaÚencoder_fuse_opÚspatial_tuning_adapter_inplanesÚencoder_typeÚuse_gatewayÚshare_bbox_headÚencoder_has_trailing_conv)ÚfloatÚdictr   ÚboolÚintr1   ÚtupleÚstr)ÚformatÚ__classdict__s   "€r+   Ú__annotate__ÚDeimv2Config.__annotate__   sì  ø‡ ‚ ñB Ñ#ñC ñD "'¨¥Ñ4ñE ñF Ñ ñG ñH Ñ ñI ñJ Ñ,Õ,¨tÕ3Ñ:ñK ñL "&Ñ,ñM ñR Ñ!ñS ñT ™c�¡U©3°¨8¥_Õ4ÑHñU ñV ‘s•)™e¡C¨ H�oÕ-Ñ;ñW ñX ÑñY ñZ Ññ[ ñ\ !Ñ$ñ] ñ^ ‘S�[Ññ_ ñ` ¡�Ñ)ña ñb ™S�	¡E©#¨s¨(¥OÕ3Ñ:ñc ñd &)Ñ0ñe ñf "%Ñ-ñg ñh Ñ%ñi ñl ‘C�y™5¡¡c �?Õ*¨TÕ1Ñ8ñm ñn Ñ"ño ñp Ñ!ñq ñv Ññw ñx Ññy ñz ™c�¡U©3°¨8¥_Õ4ÑFñ{ ñ| Ññ} ñ~ Ññ ñ@ ™D¡�I•oÑ)ñA ñB ÑñC ñD !Ñ$ñE ñF "%Ñ-ñG ñH ™s•{Ñ(ñI ñJ ÑñK ñL Ñ"ñM ñN Ñ ñO ñP Ñ%ñQ ñR ™T¡#�Y•¨Õ-Ñ4ñS ñT Ñ ñU ñZ Ññ[ ñ\ Ññ] ñ^ Ñ#ñ_ ñ` Ñ"ña ñb Ñ"ñc ñd Ññe ñf Ññg ñh Ñ"ñi ñj Ñ!ñk ñl Ñ ñm ñn Ñ!ño ñp Ñ!ñq ñr Ñ!ñs ñt Ñ ñu ñv Ñ!ñw ñx Ññy ñz ‘u•Ñ"ñ{ ñ| Ññ} ñ~ Ññ ñ@ ÑñA ñB ÑñC ñD ÑñE ñF ÑñG ñH  Ñ%ñI ñJ Ñ#ñK ñL 	�OñM ñN Ñ$ñO ñP Ñ#ñQ ñR Ñ ñS ñT Ñ%ñU ñV �t�|Ñ"ñW ñX Ñ ñY ñZ &)Ñ-ñ[ ñ\ Ñ ñ] ñ^ Ññ_ ñ` Ñ!ña ñb  $Ñ*òc r-   )r   r%   )i   r   i   )é   é   é    )r!   )r   r   r   éÿÿÿÿ)ZÚ__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú
model_typer   Úsub_configsÚlayer_typesÚattribute_mapr8   r9   r:   r;   r   r<   r=   r>   r?   r@   rA   r   rB   rC   rD   rE   rF   rG   rH   rI   rJ   r   rK   rL   rM   r3   r0   rN   r$   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   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   rw   rx   ry   rz   r{   r'   r5   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r*   rƒ   s   @@r+   r
   r
      sè  ù‡ € ñtðl €JØ$ jÐ1€KØ˜LÐ)€Kà�yØÐ8ð€Mð
  $ÐØ04ÐØ €NØ €NØ6:€OØ(,Ðð "ÐØ7HÐØ0;€LØ€NØ€OØ#$ÐØ€GØ&)ÐØ6:ÐØ+0Ð#Ø'-ÐØ%Ðà48€IØ"ÐØ!Ðð €GØ€KØ7FÐØ€OØÐØ()ÐØ€NØ#$ÐØ'-ÐØ%(ÐØ€MØ"ÐØ €OØ %ÐØ04ÐØ €Oð  €MØ€MØ #ÐØ"ÐØ"ÐØ€NØ€NØ"ÐØ!ÐØ €OØ!ÐØ!ÐØ!€OØ €OØ!€OØ€HØ"€KØ€LØ€IØ€JØ€OØ€NØ€JØ"%ÐØ#€NØ€BØ $ÐØ#ÐØ €OØ!%ÐØ"€IØ €OØ+-Ð#Ø €LØ€KØ!€OØ&*Ðõ(ò÷{ … r-   r
   N)Úhuggingface_hub.dataclassesr   Úbackbone_utilsr   Úconfiguration_utilsr   Úutilsr   Úautor   r
   Ú__all__r    r-   r+   Ú<module>r�      sO   ðõ* /å CÝ 3Ý #Ý ñ
 Ð?Ô@ØôfÐ#ó fó ó AðfðR Ð
‚r-   