
    i                         d 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)zDETR model configuration    )strict   )%consolidate_backbone_kwargs_to_config)PreTrainedConfig)auto_docstring   )
AutoConfigzfacebook/detr-resnet-50)
checkpointc                       e Zd ZU dZdZdeiZdgZddddZd	Z	e
ez  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ed<   dZeed<   dZeez  ed<   dZeez  ed<   dZeed<   dZeed<   dZeed<   dZeez  ed<   dZeez  ed<   dZ ee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ed-<   d.Z(eed/<   d*Z)eed0<   d*Z*eed1<   d,Z+eed2<   d.Z,eed3<   dZ-eed4<    fd5Z. xZ/S )6
DetrConfiga'  
    num_queries (`int`, *optional*, defaults to 100):
        Number of object queries, i.e. detection slots. This is the maximal number of objects
        [`ConditionalDetrModel`] can detect in a single image. For COCO, we recommend 100 queries.
    position_embedding_type (`str`, *optional*, defaults to `"sine"`):
        Type of position embeddings to be used on top of the image features. One of `"sine"` or `"learned"`.
    dilation (`bool`, *optional*, defaults to `False`):
        Whether to replace stride with dilation in the last convolutional block (DC5). Only supported when
        `use_timm_backbone` = `True`.

    Examples:

    ```python
    >>> from transformers import DetrConfig, DetrModel

    >>> # Initializing a DETR facebook/detr-resnet-50 style configuration
    >>> configuration = DetrConfig()

    >>> # Initializing a model (with random weights) from the facebook/detr-resnet-50 style configuration
    >>> model = DetrModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```detrbackbone_configpast_key_valuesd_modelencoder_attention_headsencoder_layers)hidden_sizenum_attention_headsnum_hidden_layersNr   num_channelsd   num_queries   i   encoder_ffn_dim   decoder_layersdecoder_ffn_dimdecoder_attention_headsg        encoder_layerdropdecoder_layerdropTis_encoder_decoderreluactivation_function   g?dropoutattention_dropoutactivation_dropoutg{Gz?init_stdg      ?init_xavier_stdFauxiliary_losssineposition_embedding_typedilation   
class_cost   	bbox_costr   	giou_costmask_loss_coefficientdice_loss_coefficientbbox_loss_coefficientgiou_loss_coefficienteos_coefficientc           	      <   |j                  di       }|j                  d| j                        dd|j                  dg d      d}| j                  r|j                  dd	      |d<   t        d| j                  d
dddgi|d|\  | _        }t        |   di | y )Nbackbone_kwargsr   TFout_indices)r.   r   r      )r   features_onlyuse_pretrained_backboner:   output_stride   resnet50resnetout_featuresstage4)r   default_backbonedefault_config_typedefault_config_kwargstimm_default_kwargs )getr   r-   r   r   super__post_init__)selfkwargsr9   rG   	__class__s       |/var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/transformers/models/detr/configuration_detr.pyrK   zDetrConfig.__post_init__\   s     **%6;+//@Q@QR!',*..}lK	
 ==3B3F3FXZ3[0'L (
 00' (#1H:"> 3(
 (
$f 	''    )0__name__
__module____qualname____doc__
model_typer	   sub_configskeys_to_ignore_at_inferenceattribute_mapr   dictr   __annotations__r   intr   r   r   r   r   r   r   r   floatr    r!   boolr#   strr   r%   r&   r'   r(   r)   r*   r,   r-   r/   r1   r2   r3   r4   r5   r6   r7   rK   __classcell__)rN   s   @rO   r   r      s   2 J$j1K#4"5 8-M 7;OT,,t3:L#KNCOS#$S$NCOS#$S$%(us{(%(us{(##%%GSGUS[%(us{(&))He OU  ND #)S)HdJIsIs!"3"!"3"!"3"!"3" OU ( (rP   r   N)rT   huggingface_hub.dataclassesr   backbone_utilsr   configuration_utilsr   utilsr   autor	   r   __all__rH   rP   rO   <module>rf      sP     . C 3 #  45U(! U(  6U(p .rP   