§
     `ƒiÇ  ã                   óP   — d dl mZ ddlmZmZ ddlmZ  G d„ de¦  «        ZdgZdS )é   )ÚPretrainedConfigé   )ÚCONFIG_MAPPINGÚ
AutoConfig)ÚSuperPointConfigc                   ót   ‡ — e Zd ZdZdZdeiZ	 	 	 	 	 	 	 	 	 	 	 	 	 ddedededede	de	de	de	de
defˆ fd„Zˆ xZS )ÚLightGlueConfigaÇ  
    This is the configuration class to store the configuration of a [`LightGlueForKeypointMatching`]. It is used to
    instantiate a LightGlue model according to the specified arguments, defining the model architecture. Instantiating a
    configuration with the defaults will yield a similar configuration to that of the LightGlue
    [ETH-CVG/lightglue_superpoint](https://huggingface.co/ETH-CVG/lightglue_superpoint) architecture.

    Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
    documentation from [`PretrainedConfig`] for more information.

    Args:
        keypoint_detector_config (`Union[AutoConfig, dict]`,  *optional*, defaults to `SuperPointConfig`):
            The config object or dictionary of the keypoint detector.
        descriptor_dim (`int`, *optional*, defaults to 256):
            The dimension of the descriptors.
        num_hidden_layers (`int`, *optional*, defaults to 9):
            The number of self and cross attention layers.
        num_attention_heads (`int`, *optional*, defaults to 4):
            The number of heads in the multi-head attention.
        num_key_value_heads (`int`, *optional*):
            This is the number of key_value heads that should be used to implement Grouped Query Attention. If
            `num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
            `num_key_value_heads=1` the model will use Multi Query Attention (MQA) otherwise GQA is used. When
            converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
            by meanpooling all the original heads within that group. For more details checkout [this
            paper](https://huggingface.co/papers/2305.13245). If it is not specified, will default to
            `num_attention_heads`.
        depth_confidence (`float`, *optional*, defaults to 0.95):
            The confidence threshold used to perform early stopping
        width_confidence (`float`, *optional*, defaults to 0.99):
            The confidence threshold used to prune points
        filter_threshold (`float`, *optional*, defaults to 0.1):
            The confidence threshold used to filter matches
        initializer_range (`float`, *optional*, defaults to 0.02):
            The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
        hidden_act (`str`, *optional*, defaults to `"gelu"`):
            The activation function to be used in the hidden layers.
        attention_dropout (`float`, *optional*, defaults to 0.0):
            The dropout ratio for the attention probabilities.
        attention_bias (`bool`, *optional*, defaults to `True`):
            Whether to use a bias in the query, key, value and output projection layers during self-attention.
        trust_remote_code (`bool`, *optional*, defaults to `False`):
            Whether to trust remote code when using other models than SuperPoint as keypoint detector.

    Examples:
        ```python
        >>> from transformers import LightGlueConfig, LightGlueForKeypointMatching

        >>> # Initializing a LightGlue style configuration
        >>> configuration = LightGlueConfig()

        >>> # Initializing a model from the LightGlue style configuration
        >>> model = LightGlueForKeypointMatching(configuration)

        >>> # Accessing the model configuration
        >>> configuration = model.config
        ```
    Ú	lightglueÚkeypoint_detector_configNé   é	   é   çffffffî?ç®Gáz®ï?çš™™™™™¹?ç{®Gáz”?Úgeluç        TFÚdescriptor_dimÚnum_hidden_layersÚnum_attention_headsÚdepth_confidenceÚwidth_confidenceÚfilter_thresholdÚinitializer_rangeÚ
hidden_actÚtrust_remote_codec                 óp  •— || _         ||z  dk    rt          d¦  «        ‚|| _        || _        || _        |€|}|| _        || _        || _        || _        |	| _	        t          |t          ¦  «        rf|                     dd¦  «        |d<   |d         t          vr"t          j        |d         | j         ¬¦  «        }nt          |d                  di |¤ddi¤Ž}|€t          d         d¬	¦  «        }|| _        || _        |d
z  | _        |
| _        || _        || _         t-          ¦   «         j        di |¤Ž d S )Né    z1descriptor_dim % num_heads is different from zeroÚ
model_typeÚ
superpointÚ_name_or_path)r   Úattn_implementationÚeager)r#   r   © )r   Ú
ValueErrorr   r   r   Únum_key_value_headsr   r   r   r   Ú
isinstanceÚdictÚgetr   r   Úfrom_pretrainedr   Úhidden_sizeÚintermediate_sizer   Úattention_dropoutÚattention_biasÚsuperÚ__init__)Úselfr   r   r   r   r'   r   r   r   r   r   r.   r/   r   ÚkwargsÚ	__class__s                  €ú‰/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/transformers/models/lightglue/configuration_lightglue.pyr1   zLightGlueConfig.__init__Y   s™  ø€ ð( "3ˆÔàÐ/Ñ/°1Ò4Ð4ÝÐPÑQÔQÐQà,ˆÔØ!2ˆÔØ#6ˆÔ ð Ð&Ø"5Ðà#6ˆÔ à 0ˆÔØ 0ˆÔØ 0ˆÔØ!2ˆÔõ Ð.µÑ5Ô5ð 		Ø5M×5QÒ5QÐR^Ð`lÑ5mÔ5mÐ$ \Ñ2Ø'¨Ô5½^ÐKÐKÝ+5Ô+EØ,¨_Ô=ÐQUÔQgð,ñ ,ô ,Ð(Ð(õ ,:Ð:RÐS_Ô:`Ô+að ,ð ,Ø.ð,ð ,ØDKð,ð ,ð ,Ð(ð $Ð+Ý'5°lÔ'CÐX_Ð'`Ñ'`Ô'`Ð$à(@ˆÔ%à)ˆÔØ!/°!Ñ!3ˆÔØ$ˆŒØ!2ˆÔØ,ˆÔØ‰ŒÔÐ"Ð"˜6Ð"Ð"Ð"Ð"Ð"ó    )Nr   r   r   Nr   r   r   r   r   r   TF)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r    r   Úsub_configsr   ÚintÚfloatÚstrÚboolr1   Ú__classcell__)r4   s   @r5   r	   r	      sé   ø€ € € € € ð8ð 8ðt €JØ-¨zÐ:€Kð 6:Ø!Ø!"Ø#$Ø Ø"&Ø"&Ø"%Ø#'Ø ØØØ"'ð?#ð ?#à"2ð?#ð ð?#ð ð	?#ð
 !ð?#ð  ð?#ð  ð?#ð  ð?#ð !ð?#ð ð?#ð  ð?#ð ?#ð ?#ð ?#ð ?#ð ?#ð ?#ð ?#ð ?#ð ?#r6   r	   N)	Úconfiguration_utilsr   Úautor   r   r!   r   r	   Ú__all__r%   r6   r5   ú<module>rD      s…   ðð, 4Ð 3Ð 3Ð 3Ð 3Ð 3Ø -Ð -Ð -Ð -Ð -Ð -Ð -Ð -Ø )Ð )Ð )Ð )Ð )Ð )ð}#ð }#ð }#ð }#ð }#Ð&ñ }#ô }#ð }#ð@ Ð
€€€r6   