Ë
    ÜÓ^j‰  ã                   ó‚   — d dl mZ ddlmZ ddlmZ ddlmZmZ ddl	m
Z
  ed¬	«      e G d
„ de«      «       «       ZdgZy)é    )Ústricté   )ÚPreTrainedConfig)Úauto_docstringé   )ÚCONFIG_MAPPINGÚ
AutoConfig)ÚSuperPointConfigzETH-CVG/lightglue_superpoint)Ú
checkpointc                   óö   ‡ — e Zd ZU dZdZdei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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z  e
d<   dZee
d<   ˆ fd„Zd„ Zˆ xZS )ÚLightGlueConfigaG  
    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.
    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

    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é   Údescriptor_dimé	   Únum_hidden_layersé   Únum_attention_headsÚnum_key_value_headsgffffffî?Údepth_confidenceg®Gáz®ï?Úwidth_confidencegš™™™™™¹?Úfilter_thresholdg{®Gáz”?Úinitializer_rangeÚgeluÚ
hidden_actg        Úattention_dropoutTÚattention_biasc                 óÌ  •— | j                   €| j                  | _         t        | j                  t        «      rX| j                  j                  dd«      | j                  d<   t        | j                  d      di | j                  ¤ddi¤Ž| _        n | j                  €t        d   d¬«      | _        | j                  dz  | _        | j                  | _	        t        ‰| �,  di |¤Ž y )NÚ
model_typeÚ
superpointÚattn_implementationÚeager)r"   r   © )r   r   Ú
isinstancer   ÚdictÚgetr   r   Úintermediate_sizeÚhidden_sizeÚsuperÚ__post_init__)ÚselfÚkwargsÚ	__class__s     €ú€/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/lightglue/configuration_lightglue.pyr+   zLightGlueConfig.__post_init__K   sÚ   ø€ Ø×#Ñ#Ð+Ø'+×'?Ñ'?ˆDÔ$ô �d×3Ñ3´TÔ:Ø:>×:WÑ:W×:[Ñ:[Ð\hÐjvÓ:wˆD×)Ñ)¨,Ñ7Ü,:¸4×;XÑ;XÐYeÑ;fÑ,gñ -Ø×/Ñ/ñ-ØELò-ˆDÕ)ð ×*Ñ*Ð2Ü,:¸<Ñ,HÐ]dÔ,eˆDÔ)à!%×!4Ñ!4°qÑ!8ˆÔØ×.Ñ.ˆÔÜ‰ÑÑ' Ó'ó    c                 óR   — | j                   | j                  z  dk7  rt        d«      ‚y)zOPart of `@strict`-powered validation. Validates the architecture of the config.r   z1descriptor_dim % num_heads is different from zeroN)r   r   Ú
ValueError)r,   s    r/   Úvalidate_architecturez%LightGlueConfig.validate_architecture]   s,   € à×Ñ ×!9Ñ!9Ñ9¸QÒ>ÜÐPÓQÐQð ?r0   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r    r	   Úsub_configsr   r&   r
   Ú__annotations__r   Úintr   r   r   r   Úfloatr   r   r   r   Ústrr   r   Úboolr+   r3   Ú__classcell__)r.   s   @r/   r   r      s¸   ø… ñð6 €JØ-¨zÐ:€Kà?CÐ˜dÐ%5Ñ5¸Ñ<ÓCØ€N�CÓØÐ�sÓØ Ð˜Ó Ø&*Ð˜˜t™Ó*Ø"Ð�eÓ"Ø"Ð�eÓ"Ø!Ð�eÓ!Ø#Ð�uÓ#Ø€J�ÓØ%(Ð�u˜s‘{Ó(Ø€N�DÓô(ö$Rr0   r   N)Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   Úautor   r	   r!   r
   r   Ú__all__r$   r0   r/   ú<module>rD      sQ   ðõ* /å 3Ý #ß -Ý )ñ Ð9Ô:ØôARÐ&ó ARó ó ;ðARðH Ð
�r0   