+
     °³j}.  ã                   óÀ  € ^ RI HtHt ^ RIt^ RIt^ RIt^ RIHtHt ^ RIH	t	 ^RI
Ht ^RIHt ]P                  P                  R R l4       tRR	 R
 llt ! R R4      tR R ltR R lt]P(                  P*                  R R l4       t]P(                  P*                  R R l4       t]P(                  P*                  R R l4       t ! R R]P2                  4      tR# )é    )ÚOptionalÚUnionN)ÚnnÚTensor)Úbox_area)Ú_log_api_usage_once)Ú	roi_alignc                óR   € V ^8„  d   QhR\         R\        \         ,          R\         /# )é   ÚlevelsÚunmerged_resultsÚreturn)r   Úlist)Úformats   "ÚX/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torchvision/ops/poolers.pyÚ__annotate__r      s%   € ÷ ñ œvð ¼¼f½ð Ì&ñ ó    c           	      ó„  € V^ ,          pVP                   VP                  rC\        P                  ! V P	                  ^ 4      VP	                  ^4      VP	                  ^4      VP	                  ^4      3W4R7      p\        \        V4      4       F¯  p\        P                  ! W8H  4      ^ ,          P                  R^^^4      pVP                  VP	                  ^ 4      W,          P	                  ^4      W,          P	                  ^4      W,          P	                  ^4      4      pVP                  ^ WqV,          4      pK±  	  V# )r   ©ÚdtypeÚdeviceéÿÿÿÿ)r   r   ÚtorchÚzerosÚsizeÚrangeÚlenÚwhereÚviewÚexpandÚscatter)r   r   Úfirst_resultr   r   ÚresÚlevelÚindexs   &&      r   Ú_onnx_merge_levelsr&      s  € à# AÕ&€LØ ×&Ñ&¨×(;Ñ(;ˆ6Ü
�+Š+Ø	�‰�Q‹˜×*Ñ*¨1Ó-¨|×/@Ñ/@ÀÓ/CÀ\×EVÑEVÐWXÓEYÐZÐbgô€Cô ”sÐ+Ó,Ö-ˆÜ—’˜F™OÓ,¨QÕ/×4Ñ4°R¸¸A¸qÓAˆØ—‘Ø�J‰J�q‹MØÕ#×(Ñ(¨Ó+ØÕ#×(Ñ(¨Ó+ØÕ#×(Ñ(¨Ó+ó	
ˆð �k‰k˜!˜U°UÕ$;Ó<Šñ .ð €Jr   c          
      óT   € V ^8„  d   QhR\         R\         R\         R\         R\        /# ©r   Úk_minÚk_maxÚcanonical_scaleÚcanonical_levelÚeps©ÚintÚfloat)r   s   "r   r   r   %   sA   € ÷ Lñ LÜðLäðLô ðLô ð	Lô
 
ñLr   c                 ó   € \        WW#V4      # ©N)ÚLevelMapper)r)   r*   r+   r,   r-   s   &&&&&r   ÚinitLevelMapperr4   %   s   € ô �u _ÀsÓKÐKr   c                   óL   a € ] tR t^/t o RtRV 3R lR lltV 3R lR ltRtV tR# )	r3   zÖDetermine which FPN level each RoI in a set of RoIs should map to based
on the heuristic in the FPN paper.

Args:
    k_min (int)
    k_max (int)
    canonical_scale (int)
    canonical_level (int)
    eps (float)
c          
      ó8   <€ V ^8„  d   QhRS[ RS[ RS[ RS[ RS[/# r(   r.   )r   Ú__classdict__s   "€r   r   ÚLevelMapper.__annotate__;   s=   ø€ ÷ ñ áðñ ðñ ð	ñ
 ðñ ñr   c                óB   € Wn         W n        W0n        W@n        WPn        R # r2   )r)   r*   Ús0Úlvl0r-   )Úselfr)   r*   r+   r,   r-   s   &&&&&&r   Ú__init__ÚLevelMapper.__init__;   s   € ð Œ
ØŒ
Ø!ŒØ#Œ	ØŽr   c                ó6   <€ V ^8„  d   QhRS[ S[,          RS[/# )r   Úboxlistsr   ©r   r   )r   r7   s   "€r   r   r8   I   s#   ø€ ÷ Jñ J¡¡f¥ð J±&ñ Jr   c           
     ó|  € \         P                  ! \         P                  ! V Uu. uF  p\        V4      NK  	  up4      4      p\         P                  ! V P
                  \         P                  ! W0P                  ,          4      ,           \         P                  ! V P                  VP                  R7      ,           4      p\         P                  ! W@P                  V P                  R7      pVP                  \         P                  4      V P                  ,
          P                  \         P                  4      # u upi )z$
Args:
    boxlists (list[BoxList])
©r   )ÚminÚmax)r   ÚsqrtÚcatr   Úfloorr;   Úlog2r:   Útensorr-   r   Úclampr)   r*   ÚtoÚint64)r<   r@   ÚboxlistÚsÚtarget_lvlss   &&   r   Ú__call__ÚLevelMapper.__call__I   s¾   € ô �JŠJ”u—y’yÁ8Ó!LÁ8¸¤(¨7Ö"3Á8Ñ!LÓMÓNˆô —k’k $§)¡)¬e¯jªj¸¿W¹W½Ó.EÕ"EÌÏÊÐUY×U]ÑU]Ðef×elÑelÔHmÕ"mÓnˆÜ—k’k +·:±:À4Ç:Á:ÔNˆØ—‘œuŸ{™{Ó+¨d¯j©jÕ8×<Ñ<¼U¿[¹[ÓIÐIùò "Ms   ¥D9)r-   r*   r)   r;   r:   N©éà   é   g�íµ ÷Æ°>)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r=   rQ   Ú__static_attributes__Ú__classdictcell__)r7   s   @r   r3   r3   /   s    ø‡ € ñ	÷ò ÷Jö Jr   r3   c                óF   € V ^8„  d   QhR\         \        ,          R\        /# )r   Úboxesr   rA   )r   s   "r   r   r   W   s   € ÷ ñ ¤$¤v¥,ð ´6ñ r   c                 óf  € \         P                  ! V ^ R7      pVP                  VP                  r2\         P                  ! \	        V 4       UUu. uF4  w  rE\         P
                  ! VR,          WC\         P                  VR7      NK6  	  upp^ R7      p\         P                  ! Wa.^R7      pV# u uppi )r   )Údim)r   Úlayoutr   ):NNN:Né   N)r   rG   r   r   Ú	enumerateÚ	full_likeÚstrided)r^   Úconcat_boxesr   r   ÚiÚbÚidsÚroiss   &       r   Ú_convert_to_roi_formatrk   W   sŒ   € Ü—9’9˜U¨Ô*€LØ ×'Ñ'¨×);Ñ);ˆEÜ
�)Š)ÜdmÐnsÔdtÔuÑdtÑ\`Ð\]Œ�Š˜˜5� 1¼%¿-¹-ÐPV×	WÑdtÒuØô€Cô �9Š9�cÐ(¨aÔ0€DØ€Kùó	 	vs   Á:B-
c                óR   € V ^8„  d   QhR\         R\        \        ,          R\        /# )r   ÚfeatureÚoriginal_sizer   )r   r   r/   r0   )r   s   "r   r   r   b   s%   € ÷ ñ œ&ð ´´cµð ¼uñ r   c                 ó:  € V P                   RR p. p\        W!4       Fs  w  rE\        V4      \        V4      ,          p^\        \        P                  ! V4      P                  4       P                  4       4      ,          pVP                  V4       Ku  	  V^ ,          # )r   Néþÿÿÿ)ÚshapeÚzipr0   r   rJ   rI   ÚroundÚappend)rm   rn   r   Úpossible_scalesÚs1Ús2Úapprox_scaleÚscales   &&      r   Ú_infer_scalerz   b   s   € à�=‰=˜˜Ð€DØ#%€OÜ�dÖ*‰ˆÜ˜R“y¤5¨£9Õ,ˆØ”Uœ5Ÿ<š<¨Ó5×:Ñ:Ó<×BÑBÓDÓEÕEˆØ×Ñ˜uÖ%ñ +ð ˜1ÕÐr   c                óÚ   € V ^8„  d   QhR\         \        ,          R\         \        \        \        3,          ,          R\        R\        R\        \         \        ,          \
        3,          /# )r   ÚfeaturesÚimage_shapesr+   r,   r   )r   r   Útupler/   r0   r3   )r   s   "r   r   r   n   sS   € ÷ ñ Ü”6�lðÜ*.¬u´S¼#°X­Õ*?ðÜRUðÜhkðä
Œ4”�;œÐ#Õ$ñr   c                 óZ  € V'       g   \        R 4      h^ p^ pV F)  p\        V^ ,          V4      p\        V^,          V4      pK+  	  WE3pV  Uu. uF  p\        W‡4      NK  	  p	p\        P                  ! \        P
                  ! V	^ ,          \        P                  R7      4      P                  4       ) p
\        P                  ! \        P
                  ! V	R,          \        P                  R7      4      P                  4       ) p\        \        V
4      \        V4      VVR7      pWœ3# u upi )zimages list should not be emptyrC   )r+   r,   r   )
Ú
ValueErrorrE   rz   r   rI   rJ   Úfloat32Úitemr4   r/   )r|   r}   r+   r,   Úmax_xÚmax_yrq   Úoriginal_input_shapeÚfeatÚscalesÚlvl_minÚlvl_maxÚ
map_levelss   &&&&         r   Ú_setup_scalesr‹   m   sõ   € ÷ ÜÐ:Ó;Ð;Ø€EØ€EÛˆÜ�E˜!•H˜eÓ$ˆÜ�E˜!•H˜eÓ$Šñ ð "˜>ÐáCKÓLÁ8¸4Œl˜4Ö6Á8€FÐLô �zŠzœ%Ÿ,š, v¨a¥y¼¿¹ÔFÓG×LÑLÓNÐN€GÜ�zŠzœ%Ÿ,š, v¨b¥z¼¿¹ÔGÓH×MÑMÓOÐO€Gä ÜˆG‹ÜˆG‹Ø'Ø'ô	€Jð ÐÐùò Ms   ÁD(c                óŠ   € V ^8„  d   QhR\         \        \        3,          R\        \        ,          R\        \        ,          /# )r   ÚxÚfeatmap_namesr   )ÚdictÚstrr   r   )r   s   "r   r   r   Š   s2   € ÷ ñ ”Tœ#œv˜+Õ&ð ´t¼Cµyð ÄTÌ&Å\ñ r   c                 ón   € . pV P                  4        F  w  r4W19   g   K  VP                  V4       K   	  V# r2   )Úitemsrt   )r�   rŽ   Ú
x_filteredÚkÚvs   &&   r   Ú_filter_inputr–   ‰   s5   € à€JØ—‘–	‰ˆØÖØ×Ñ˜aÖ ñ ð Ðr   c                óð   € V ^8„  d   QhR\         \        ,          R\         \        ,          R\         \        ,          R\        R\        \         \        ,          ,          R\        \
        ,          R\        /# )r   r“   r^   Úoutput_sizeÚsampling_ratior‡   Úmapperr   )r   r   r/   r   r0   r3   )r   s   "r   r   r   “   sq   € ÷ Pñ PÜ”V•ðPä”�<ðPô ”c•ðPô ð	Pô
 ”Tœ%•[Õ!ðPô ”[Õ!ðPô ñPr   c           	     óB  € Ve   Vf   \        R4      h\        V 4      p\        V4      pV^8X  d   \        V ^ ,          VVV^ ,          VR7      # V! V4      p\        V4      p	V ^ ,          P                  ^,          p
V ^ ,          P
                  V ^ ,          P                  rË\        P                  ! V	V
3V,           VVR7      p. p\        \        W4      4       Fœ  w  pw  pp\        P                  ! W�8H  4      ^ ,          pVV,          p\        VVVVVR7      p\        P                  ! 4       '       d#   VP                  VP                  V4      4       K~  VP                  VP
                  4      VV&   Kž  	  \        P                  ! 4       '       d   \!        WŽ4      pV# )aµ  
Args:
    x_filtered (List[Tensor]): List of input tensors.
    boxes (List[Tensor[N, 4]]): boxes to be used to perform the pooling operation, in
        (x1, y1, x2, y2) format and in the image reference size, not the feature map
        reference. The coordinate must satisfy ``0 <= x1 < x2`` and ``0 <= y1 < y2``.
    output_size (Union[List[Tuple[int, int]], List[int]]): size of the output
    sampling_ratio (int): sampling ratio for ROIAlign
    scales (Optional[List[float]]): If None, scales will be automatically inferred. Default value is None.
    mapper (Optional[LevelMapper]): If none, mapper will be automatically inferred. Default value is None.
Returns:
    result (Tensor)
z$scales and mapper should not be None)r˜   Úspatial_scaler™   r   )r€   r   rk   r	   rq   r   r   r   r   rc   rr   r   ÚtorchvisionÚ_is_tracingrt   rL   r&   )r“   r^   r˜   r™   r‡   rš   Ú
num_levelsrj   r   Únum_roisÚnum_channelsr   r   ÚresultÚtracing_resultsr$   Úper_level_featurery   Úidx_in_levelÚrois_per_levelÚresult_idx_in_levels   &&&&&&               r   Ú_multiscale_roi_alignr¨   ’   s‹  € ð, ‚~˜šÜÐ?Ó@Ð@ä�Z“€JÜ! %Ó(€Dà�Q„ÜØ�q�MØØ#Ø  �)Ø)ô
ð 	
ñ �E‹]€Fä�4‹y€HØ˜a•=×&Ñ& qÕ)€Là˜q•M×'Ñ'¨°A­×)=Ñ)=ˆ6Ü�[Š[àØð	
ð õ		ð
 Øô€Fð €OÜ-6´s¸:Ó7NÖ-OÑ)ˆÑ)Ð! 5Ü—{’{ 6¡?Ó3°AÕ6ˆØ˜lÕ+ˆä'ØØØ#ØØ)ô
Ðô ×"Ò"×$Ò$Ø×"Ñ"Ð#6×#9Ñ#9¸%Ó#@ÖAð $7×#9Ñ#9¸&¿,¹,Ó#GˆF�<Ó ñ- .Pô0 ×Ò× Ò Ü# FÓ<ˆà€Mr   c                   ó¨   a a€ ] tR t^æt oRtR]]],          ,          R]],          /t	R^àR^/V3R lV 3R lllt
V3R lR	 ltV3R
 lR ltRtVtV ;t# )ÚMultiScaleRoIAligna  
Multi-scale RoIAlign pooling, which is useful for detection with or without FPN.

It infers the scale of the pooling via the heuristics specified in eq. 1
of the `Feature Pyramid Network paper <https://arxiv.org/abs/1612.03144>`_.
They keyword-only parameters ``canonical_scale`` and ``canonical_level``
correspond respectively to ``224`` and ``k0=4`` in eq. 1, and
have the following meaning: ``canonical_level`` is the target level of the pyramid from
which to pool a region of interest with ``w x h = canonical_scale x canonical_scale``.

Args:
    featmap_names (List[str]): the names of the feature maps that will be used
        for the pooling.
    output_size (List[Tuple[int, int]] or List[int]): output size for the pooled region
    sampling_ratio (int): sampling ratio for ROIAlign
    canonical_scale (int, optional): canonical_scale for LevelMapper
    canonical_level (int, optional): canonical_level for LevelMapper

Examples::

    >>> m = torchvision.ops.MultiScaleRoIAlign(['feat1', 'feat3'], 3, 2)
    >>> i = OrderedDict()
    >>> i['feat1'] = torch.rand(1, 5, 64, 64)
    >>> i['feat2'] = torch.rand(1, 5, 32, 32)  # this feature won't be used in the pooling
    >>> i['feat3'] = torch.rand(1, 5, 16, 16)
    >>> # create some random bounding boxes
    >>> boxes = torch.rand(6, 4) * 256; boxes[:, 2:] += boxes[:, :2]
    >>> # original image size, before computing the feature maps
    >>> image_sizes = [(512, 512)]
    >>> output = m(i, [boxes], image_sizes)
    >>> print(output.shape)
    >>> torch.Size([6, 5, 3, 3])

r‡   rŠ   r+   r,   c          
      ó‚   <€ V ^8„  d   QhRS[ S[,          RS[S[S[S[,          S[ S[,          3,          RS[RS[RS[/# )r   rŽ   r˜   r™   r+   r,   )r   r�   r   r/   r~   )r   r7   s   "€r   r   ÚMultiScaleRoIAlign.__annotate__  sU   ø€ ÷ /ñ /á™C•yð/ñ ™3¡¡c¥
©D±­IÐ5Õ6ð/ñ ð	/ñ ð/ñ ñ/r   c               óØ   <€ \         SV `  4        \        V 4       \        V\        4      '       d   W"3pWn        W0n        \        V4      V n        R V n	        R V n
        W@n        WPn        R # r2   )Úsuperr=   r   Ú
isinstancer/   rŽ   r™   r~   r˜   r‡   rŠ   r+   r,   )r<   rŽ   r˜   r™   r+   r,   Ú	__class__s   &&&&$$€r   r=   ÚMultiScaleRoIAlign.__init__  s`   ø€ ô 	‰ÑÔÜ˜DÔ!Ü�k¤3×'Ò'Ø&Ð4ˆKØ*ÔØ,ÔÜ  Ó-ˆÔØˆŒØˆŒØ.ÔØ.Ör   c          	      ó~   <€ V ^8„  d   QhRS[ S[S[3,          RS[S[,          RS[S[S[S[3,          ,          RS[/# )r   r�   r^   r}   r   )r�   r�   r   r   r~   r/   )r   r7   s   "€r   r   r¬   !  sM   ø€ ÷  
ñ  
á‘‘V�Õð 
ñ ‘F�|ð 
ñ ™5¡¡c �?Õ+ð	 
ñ
 
ñ 
r   c                ó0  € \        WP                  4      pV P                  e   V P                  f/   \	        WCV P
                  V P                  4      w  V n        V n        \        VVV P                  V P                  V P                  V P                  4      # )a¨  
Args:
    x (OrderedDict[Tensor]): feature maps for each level. They are assumed to have
        all the same number of channels, but they can have different sizes.
    boxes (List[Tensor[N, 4]]): boxes to be used to perform the pooling operation, in
        (x1, y1, x2, y2) format and in the image reference size, not the feature map
        reference. The coordinate must satisfy ``0 <= x1 < x2`` and ``0 <= y1 < y2``.
    image_shapes (List[Tuple[height, width]]): the sizes of each image before they
        have been fed to a CNN to obtain feature maps. This allows us to infer the
        scale factor for each one of the levels to be pooled.
Returns:
    result (Tensor)
)
r–   rŽ   r‡   rŠ   r‹   r+   r,   r¨   r˜   r™   )r<   r�   r^   r}   r“   s   &&&& r   ÚforwardÚMultiScaleRoIAlign.forward!  s‚   € ô& # 1×&8Ñ&8Ó9ˆ
Ø�;‰;Ò $§/¡/Ò"9Ü+8Ø¨$×*>Ñ*>À×@TÑ@Tó,Ñ(ˆDŒK˜œô %ØØØ×ÑØ×ÑØ�K‰KØ�O‰Oó
ð 	
r   c                ó    <€ V ^8„  d   QhRS[ /# )r   r   )r�   )r   r7   s   "€r   r   r¬   C  s   ø€ ÷ 
ñ 
™#ñ 
r   c                ó‚   € V P                   P                   R V P                   RV P                   RV P                   R2# )z(featmap_names=z, output_size=z, sampling_ratio=Ú))r°   rV   rŽ   r˜   r™   )r<   s   &r   Ú__repr__ÚMultiScaleRoIAlign.__repr__C  sM   € à�~‰~×&Ñ&Ð' °t×7IÑ7IÐ6Jð KØ×+Ñ+Ð,Ð,=¸d×>QÑ>QÐ=RÐRSðUð	
r   )r,   r+   rŽ   rŠ   r˜   r™   r‡   )rV   rW   rX   rY   rZ   r   r   r0   r3   Ú__annotations__r=   r´   r¹   r[   r\   Ú__classcell__)r°   r7   s   @@r   rª   rª   æ   sa   ù‡ € ñ!ðF   ¨$¨u­+Õ!6¸ÀhÈ{ÕF[Ð\€Oð/ð  #ð/ð  !÷/õ /÷* 
ð  
÷D
÷ 
ð 
r   rª   rS   )Útypingr   r   r   Útorch.fxr�   r   r   Útorchvision.ops.boxesr   Úutilsr   r	   ÚjitÚunusedr&   r4   r3   rk   rz   ÚfxÚwrapr‹   r–   r¨   ÚModulerª   © r   r   Ú<module>rÇ      sÁ   ðß "ã Û Û ß Ý *å 'Ý  ð ‡�×Ñôó ð÷&L÷%Jñ %JõPõð ‡�‡�ôó ðð6 ‡�‡�ôó ðð ‡�‡�ôPó ðPôfa
˜Ÿ™ö a
r   