
    Z j                     |    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_confidencegGz?width_confidenceg?filter_thresholdg{Gz?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     چ/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/transformers/models/lightglue/configuration_lightglue.pyr,   LightGlueConfig.__post_init__K   s    ##+'+'?'?D$ d33T:::>:W:W:[:[\hjv:wD)),7,:4;X;XYe;f,g -//-EL-D) **2,:<,H]d,eD)!%!4!4q!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9Q>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NCs  &*t*"e""e"!e!#u#J%(us{(ND($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   