+
    œ°³j°  ã                   ó¸   € ^ RI Ht ^RIHtHt ^RIHt ^RIHt ^RI	H
t
 ]! 4       '       d   ^ RIt]'       d   ^RIHt  ! R R	]
4      t ! R
 R]4      tR	R.tR# )é    )ÚTYPE_CHECKING)Ú
TensorTypeÚis_torch_available)Úrequires)ÚSuperGlueImageProcessorPil)ÚSuperGlueImageProcessorN)Ú$EfficientLoFTRKeypointMatchingOutputc                   ó6   a € ] tR t^t o RV 3R lR lltRtV tR# )ÚEfficientLoFTRImageProcessorc                óŠ   <€ V ^8„  d   QhRRRS[ S[S[,          ,          RS[RS[S[S[S[P                  3,          ,          /# )é   Úoutputsr	   Útarget_sizesÚ	thresholdÚreturn)r   ÚlistÚtupleÚfloatÚdictÚstrÚtorchÚTensor)ÚformatÚ__classdict__s   "€Úz/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/efficientloftr/modular_efficientloftr.pyÚ__annotate__Ú)EfficientLoFTRImageProcessor.__annotate__   sO   ø€ ÷ 9ñ 9à7ð9ñ !¡4©¥;Õ.ð9ñ ð	9ñ
 
‰d‘3™Ÿ™Ð$Õ%Õ	&ñ9ó    c           	     ó  € VP                   P                  ^ ,          \        V4      8w  d   \        R4      h\        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       g   \        R4      h\        V\        4      '       d-   \        P                  ! W!P                   P                  R7      pM=VP                  ^,          ^8w  g   VP                  ^,          ^8w  d   \        R4      hTpVP                  P                  4       pWTP                  R
4      P                  R
^^^4      ,          pVP                  \        P                  4      p. p\!        WQP                   VP"                  4       F~  w  rxp	\        P$                  ! W“8„  VR
8„  4      p
V^ ,          V
^ ,          ,          pV^,          V
^,          ,          pV	^ ,          V
^ ,          ,          pVP'                  RVRVR	V/4       K€  	  V# )á}  
Converts the raw output of [`EfficientLoFTRKeypointMatchingOutput`] into lists of keypoints, scores and descriptors
with coordinates absolute to the original image sizes.
Args:
    outputs ([`EfficientLoFTRKeypointMatchingOutput`]):
        Raw outputs of the model.
    target_sizes (`torch.Tensor` or `List[Tuple[Tuple[int, int]]]`, *optional*):
        Tensor of shape `(batch_size, 2, 2)` or list of tuples of tuples (`Tuple[int, int]`) containing the
        target size `(height, width)` of each image in the batch. This must be the original image size (before
        any processing).
    threshold (`float`, *optional*, defaults to 0.0):
        Threshold to filter out the matches with low scores.
Returns:
    `List[Dict]`: A list of dictionaries, each dictionary containing the keypoints in the first and second image
    of the pair, the matching scores and the matching indices.
úRMake sure that you pass in as many target sizes as the batch dimension of the maskc              3   ó>   "  € T F  p\        V4      ^8H  x € K  	  R# 5i©r   N©Úlen©Ú.0Útarget_sizes   & r   Ú	<genexpr>ÚNEfficientLoFTRImageProcessor.post_process_keypoint_matching.<locals>.<genexpr>)   ó   é € ÐI¹L¨[”3�{Ó# qÖ(»Lùó   ‚FTúTEach element of target_sizes must contain the size (h, w) of each image of the batch©ÚdeviceÚ
keypoints0Ú
keypoints1Úmatching_scoreséÿÿÿÿ)ÚmatchesÚshaper%   Ú
ValueErrorÚallÚ
isinstancer   r   Útensorr/   Ú	keypointsÚcloneÚflipÚreshapeÚtoÚint32Úzipr2   Úlogical_andÚappend)Úselfr   r   r   Úimage_pair_sizesr:   ÚresultsÚkeypoints_pairr4   ÚscoresÚvalid_matchesÚmatched_keypoints0Úmatched_keypoints1r2   s   &&&&          r   Úpost_process_keypoint_matchingÚ;EfficientLoFTRImageProcessor.post_process_keypoint_matching   s«  € ð, �?‰?× Ñ  Õ#¤s¨<Ó'8Ô8ÜÐqÓrÐrß‹sÑI¹LÓI�s�sŠsÑI¹LÓI×IÒIÜÐsÓtÐtä�l¤D×)Ò)Ü$Ÿ|š|¨LÇÁ×AWÑAWÔXÑà×!Ñ! !Õ$¨Ô)¨\×-?Ñ-?ÀÕ-BÀaÔ-GÜ Øjóð ð  ,Ðà×%Ñ%×+Ñ+Ó-ˆ	Ø× 5Ñ 5°bÓ 9× AÑ AÀ"ÀaÈÈAÓ NÕNˆ	Ø—L‘L¤§¡Ó-ˆ	àˆÜ/2°9¿o¹oÈw×OfÑOfÖ/gÑ+ˆN Vä!×-Ò-¨fÑ.@À'ÈBÁ,ÓOˆMà!/°Õ!2°=ÀÕ3CÕ!DÐØ!/°Õ!2°=ÀÕ3CÕ!DÐØ$ Q�i¨°aÕ(8Õ9ˆOà�N‰Nà Ð"4Ø Ð"4Ø% ðöñ 0hð  ˆr   © N©g        )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__rK   Ú__static_attributes__Ú__classdictcell__©r   s   @r   r   r      s   ø‡ € ÷9÷ 9ð 9r   r   c                   óN   a € ] tR t^Mt o ]! RR7      RV 3R lR ll4       tRtV tR# )ÚEfficientLoFTRImageProcessorPil)Úbackendsc                ót   <€ V ^8„  d   QhRRRS[ S[S[,          ,          RS[RS[S[S[R3,          ,          /# )r   r   r	   r   r   r   ztorch.Tensor)r   r   r   r   r   r   )r   r   s   "€r   r   Ú,EfficientLoFTRImageProcessorPil.__annotate__O   sK   ø€ ÷ ;ñ ;à7ð;ñ !¡4©¥;Õ.ð;ñ ð	;ñ
 
‰d‘3˜Ð&Õ'Õ	(ñ;r   c           	     óö  € ^ RI pVP                  P                  ^ ,          \        V4      8w  d   \	        R4      h\
        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       g   \	        R4      h\        V\        4      '       d)   VP                  ! W!P                  P                  R7      pM=VP                  ^,          ^8w  g   VP                  ^,          ^8w  d   \	        R4      hTpVP                  P                  4       pWeP                  R4      P                  R^^^4      ,          pVP                  VP                  4      p. p\!        WaP                  VP"                  4       Fz  w  r‰p
VP$                  ! W£8„  V	R8„  4      pV^ ,          V^ ,          ,          pV^,          V^,          ,          pV
^ ,          V^ ,          ,          pVP'                  RVR	VR
V/4       K|  	  V# )r    Nr!   c              3   ó>   "  € T F  p\        V4      ^8H  x € K  	  R# 5ir#   r$   r&   s   & r   r)   ÚQEfficientLoFTRImageProcessorPil.post_process_keypoint_matching.<locals>.<genexpr>i   r+   r,   FTr-   r.   r0   r1   r2   r3   )r   r4   r5   r%   r6   r7   r8   r   r9   r/   r:   r;   r<   r=   r>   r?   r@   r2   rA   rB   )rC   r   r   r   r   rD   r:   rE   rF   r4   rG   rH   rI   rJ   r2   s   &&&&           r   rK   Ú>EfficientLoFTRImageProcessorPil.post_process_keypoint_matchingN   s®  € ó. 	à�?‰?× Ñ  Õ#¤s¨<Ó'8Ô8ÜÐqÓrÐrß‹sÑI¹LÓI�s�sŠsÑI¹LÓI×IÒIÜÐsÓtÐtä�l¤D×)Ò)Ø$Ÿ|š|¨LÇÁ×AWÑAWÔXÑà×!Ñ! !Õ$¨Ô)¨\×-?Ñ-?ÀÕ-BÀaÔ-GÜ Øjóð ð  ,Ðà×%Ñ%×+Ñ+Ó-ˆ	Ø× 5Ñ 5°bÓ 9× AÑ AÀ"ÀaÈÈAÓ NÕNˆ	Ø—L‘L §¡Ó-ˆ	àˆÜ/2°9¿o¹oÈw×OfÑOfÖ/gÑ+ˆN Và!×-Ò-¨fÑ.@À'ÈBÁ,ÓOˆMà!/°Õ!2°=ÀÕ3CÕ!DÐØ!/°Õ!2°=ÀÕ3CÕ!DÐØ$ Q�i¨°aÕ(8Õ9ˆOà�N‰Nà Ð"4Ø Ð"4Ø% ðöñ 0hð  ˆr   rM   N)r   rN   )rO   rP   rQ   rR   r   rK   rS   rT   rU   s   @r   rW   rW   M   s!   ø‡ € Ù�zÔ"÷;ñ ;ó #ö;r   rW   )Útypingr   Úutilsr   r   Úutils.import_utilsr   Ú(superglue.image_processing_pil_supergluer   Ú$superglue.image_processing_supergluer   r   Úmodeling_efficientloftrr	   r   rW   Ú__all__rM   r   r   Ú<module>rf      sQ   ðÝ  ç 3Ý *Ý QÝ Jñ ×ÒÛçÝMô:Ð#:ô :ôz=Ð&@ô =ð@ *Ð+LÐ
M‚r   