ó
    qyüi‰  ã                   ó|   • S SK Jr  SSKJr  SSKJr  SSKJrJr  SSK	J
r
  \" SS	9\ " S
 S\5      5       5       rS/rg)é    )Ústricté   )ÚPreTrainedConfig)Úauto_docstringé   )ÚCONFIG_MAPPINGÚ
AutoConfig)ÚSuperPointConfigzETH-CVG/lightglue_superpoint)Ú
checkpointc                   ó   ^ • \ rS rSr% SrSrS\0rSr\	\
-  S-  \S'   Sr\\S'   Sr\\S	'   S
r\\S'   Sr\S-  \S'   Sr\\S'   Sr\\S'   Sr\\S'   Sr\\S'   Sr\\S'   Sr\\-  \S'   Sr\\S'   U 4S jrS rSrU =r$ )ÚLightGlueConfigé   aó  
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                 óÚ  >• U R                   c  U R                  U l         [        U R                  [        5      (       aY  U R                  R                  SS5      U R                  S'   [        U R                  S      " S0 U R                  DSS0D6U l        OU R                  c  [        S   " SS9U l        U R                  S-  U l        U R                  U l	        [        TU ],  " S0 UD6  g )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     €Úr/home/mande/repo/quber/.venv/lib/python3.13/site-packages/transformers/models/lightglue/configuration_lightglue.pyr,   Ú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                 óT   • U R                   U R                  -  S:w  a  [        S5      eg)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    r0   Úvalidate_architectureÚ%LightGlueConfig.validate_architecture]   s,   € à×Ñ ×!9Ñ!9Ñ9¸QÓ>ÜÐPÓQÐQð ?r2   )r*   r)   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r!   r	   Úsub_configsr   r'   r
   Ú__annotations__r   Úintr   r   r   r   Úfloatr   r   r   r   Ústrr   r   Úboolr,   r5   Ú__static_attributes__Ú__classcell__)r/   s   @r0   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ð Rr2   r   N)Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   Úautor   r	   r"   r
   r   Ú__all__r%   r2   r0   Ú<module>rI      sQ   ðõ* /å 3Ý #ß -Ý )ñ Ð9Ñ:ØôARÐ&ó ARó ó ;ðARðH Ð
�r2   