ó
    EñiS$  ã                  óH  • S SK Jr  S SKrS SKrS SKJr  S SKJr  S SKJ	r	J
r
Jr  S SKrS SKrS SKJr  S SKJr  S SKJrJrJr  S S	KJrJrJr  S S
KJrJr  SS jrSS jrSS jr SS jr!S r"SS jr#S S jr$S!S jr%S"S jr&S#S jr'S$S jr(S%S jr)S&S jr*S'S jr+S(S jr,S(S jr-g))é    )ÚannotationsN)ÚSequence)Úsuppress)ÚAnyÚCallableÚLiteral)Ú
tv_tensors)Úsequence_to_str)Ú_check_sequence_inputÚ_setup_angleÚ_setup_size)Úget_dimensionsÚget_sizeÚis_pure_tensor)Ú	_FillTypeÚ_FillTypeJITc                óº  • [        U [        [        [        45      (       d  [	        U S[        U 5       35      e[        U [        5      (       a)  [        U 5      S;  a  [        SU S[        U 5       35      e[        U [        5      (       a=  U  H7  n[        U[        [        45      (       a  M   [        U S[        U5       35      e   [        U [        [        45      (       a  [        U 5      [        U 5      /n U $ [        U [        5      (       aI  [        U 5      S:X  a  [        U S   5      [        U S   5      /n U $ [        U S   5      [        U S   5      /n U $ )Nz2 should be a number or a sequence of numbers. Got )é   é   zIf z0 is a sequence its length should be 1 or 2. Got z& should be a sequence of numbers. Got r   r   )Ú
isinstanceÚintÚfloatr   Ú	TypeErrorÚtypeÚlenÚ
ValueError)ÚargÚnameÚelements      Ú]/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torchvision/transforms/v2/_utils.pyÚ_setup_number_or_seqr!      s<  € Ü�cœC¤¬Ð1×2Ñ2Ü˜4˜&Ð RÔSWÐX[ÓS\ÐR]Ð^Ó_Ð_Ü�#”x× Ñ ¤S¨£X°VÓ%;Ü˜3˜t˜fÐ$TÔUXÐY\ÓU]ÐT^Ð_Ó`Ð`Ü�#”x× Ñ ÛˆGÜ˜g¬¬U |×4Ó4Ü  D 6Ð)OÔPTÐU\ÓP]ÈÐ!_Ó`Ð`ñ ô �#œœU�|×$Ñ$Ü�S‹zœ5 ›:Ð&ˆð €Jô 
�Cœ×	"Ñ	"Üˆs‹8�q‹=Ü˜˜Q™“=¤%¨¨A©£-Ð0ˆCð €Jô ˜˜Q™“=¤%¨¨A©£-Ð0ˆCØ€Jó    c                óæ   • [        U [        5      (       a#  U R                  5        H  n[        U5        M     g U b6  [        U [        R
                  [        [        45      (       d  [        S5      eg g )NzNGot inappropriate fill arg, only Numbers, tuples, lists and dicts are allowed.)	r   ÚdictÚvaluesÚ_check_fill_argÚnumbersÚNumberÚtupleÚlistr   )ÚfillÚvalues     r    r&   r&   *   s[   € Ü�$œ×ÑØ—[‘[–]ˆEÜ˜EÖ"ò #ð Ñ¤J¨t´g·n±nÄeÌTÐ5R×$SÑ$SÜÐlÓmÐmð %TÐr"   c                ó˜   • U c  U $ [        U [        [        45      (       d$  [        U 5       Vs/ s H  n[        U5      PM     n nU $ s  snf ©N)r   r   r   r*   )r+   Úvs     r    Ú_convert_fill_argr0   3   sE   € ð
 �|Øˆä�dœS¤%˜L×)Ñ)Ü"& t¤*Ó-¢*˜Q”�a–¡*ˆÐ-Ø€Kùò .s   ®Ac                ó¬   • [        U 5        [        U [        5      (       a(  U R                  5        H  u  p[	        U5      X'   M     U $ S[	        U 5      0$ )NÚothers)r&   r   r$   Úitemsr0   )r+   Úkr/   s      r    Ú_setup_fill_argr5   @   sK   € Ü�DÔä�$œ×ÑØ—J‘J–L‰DˆAÜ'¨Ó*ˆD‹Gñ !àˆàÔ+¨DÓ1Ð2Ð2r"   c                óB   • X;   a  X   $ SU ;   a  U S   $ [        S5        g )Nr2   zWThis should never happen, please open an issue on the torchvision repo if you hit this.)ÚRuntimeError)Ú	fill_dictÚ	inpt_types     r    Ú	_get_fillr:   K   s-   € ØÓØÑ#Ð#Ø	�YÓ	Ø˜Ñ"Ð"äÐnÕor"   c                óê   • SU  S3n[        U [        [        45      (       a2  [        U 5      S;  d  [	        S U  5       5      (       d  [        U5      eg [        U [        5      (       d  [        U5      eg )NzEPadding must be an int or a 1, 2, or 4 element of tuple or list, got Ú.)r   r   é   c              3  óB   #   • U  H  n[        U[        5      v •  M     g 7fr.   )r   r   )Ú.0Úps     r    Ú	<genexpr>Ú%_check_padding_arg.<locals>.<genexpr>X   s   é € Ð3XÒPWÈ1´J¸qÄ#×4FÐ4FÒPWùs   ‚)r   r)   r*   r   Úallr   r   )ÚpaddingÚerr_msgs     r    Ú_check_padding_argrF   T   so   € àUÐV]ÐU^Ð^_Ð`€GÜ�'œE¤4˜=×)Ñ)Üˆw‹<˜yÓ(´Ñ3XÑPWÓ3X×0XÑ0XÜ˜WÓ%Ð%ð 1Yä˜¤×%Ñ%Ü˜Ó!Ð!ð &r"   c                ó&   • U S;  a  [        S5      eg )N)ÚconstantÚedgeÚreflectÚ	symmetriczBPadding mode should be either constant, edge, reflect or symmetric)r   )Úpadding_modes    r    Ú_check_padding_mode_argrM   `   s   € ØÐGÓGÜÐ]Ó^Ð^ð Hr"   c                ó(  • [        U [        [        45      (       a  U S   n [        U 5      (       a  U $ [        U [        R
                  R                  5      (       d  [        SU  S35      eSn[        [        5         [        S U R                  5        5       5      nSSS5        Uc8  [        [        5         [        S U R                  5        5       5      nSSS5        Uc  [        S5      eX   $ ! , (       d  f       N[= f! , (       d  f       N1= f)aD  
This heuristic covers three cases:

1. The input is tuple or list whose second item is a labels tensor. This happens for already batched
   classification inputs for MixUp and CutMix (typically after the Dataloder).
2. The input is a tuple or list whose second item is a dictionary that contains the labels tensor
   under a label-like (see below) key. This happens for the inputs of detection models.
3. The input is a dictionary that is structured as the one from 2.

What is "label-like" key? We first search for an case-insensitive match of 'labels' inside the keys of the
dictionary. This is the name our detection models expect. If we can't find that, we look for a case-insensitive
match of the term 'label' anywhere inside the key, i.e. 'FooLaBeLBar'. If we can't find that either, the dictionary
contains no "label-like" key.
r   z�When using the default labels_getter, the input passed to forward must be a dictionary or a two-tuple whose second item is a dictionary or a tensor, but got z	 instead.Nc              3  óP   #   • U  H  oR                  5       S :X  d  M  Uv •  M     g7f)ÚlabelsN©Úlower©r?   Úkeys     r    rA   Ú1_find_labels_default_heuristic.<locals>.<genexpr>„   s   é € ÐUªM S¿Y¹Y»[ÈHÑ=TŸS™SªMùs   ‚&�	&c              3  óR   #   • U  H  nS UR                  5       ;   d  M  Uv •  M     g7f)ÚlabelNrQ   rS   s     r    rA   rU   ‡   s   é € Ð X²¨ÀÈCÏIÉIËKÑAW§¡²ùs   ‚'ž	'z²Could not infer where the labels are in the sample. Try passing a callable as the labels_getter parameter?If there are no labels in the sample by design, pass labels_getter=None.)r   r)   r*   r   ÚcollectionsÚabcÚMappingr   r   ÚStopIterationÚnextÚkeys)ÚinputsÚcandidate_keys     r    Ú_find_labels_default_heuristicr`   e   sð   € ô  �&œ5¤$˜-×(Ñ(Ø˜‘ˆô �f×ÑØˆä�fœkŸo™o×5Ñ5×6Ñ6ÜðFØFLÀXÈYðXó
ð 	
ð
 €MÜ	”-Õ	 ÜÑU¨F¯K©K¬MÓUÓUˆ÷ 
!àÑÜ”mÕ$Ü Ñ X°·±´Ó XÓXˆM÷ %àÑÜðWó
ð 	
ð
 Ñ Ð ÷ 
!Õ	 ú÷ %Õ$ús   Á<!C2Â7!DÃ2
D Ä
Dc                óh   • U S:X  a  [         $ [        U 5      (       a  U $ U c  S $ [        SU  S35      e)NÚdefaultc                ó   • g r.   © )Ú_s    r    Ú<lambda>Ú&_parse_labels_getter.<locals>.<lambda>—   s   € ˜r"   zGlabels_getter should either be 'default', a callable, or None, but got r<   )r`   Úcallabler   )Úlabels_getters    r    Ú_parse_labels_getterrj   ‘   sE   € Ø˜	Ó!Ü-Ð-Ü	�-×	 Ñ	 ØÐØ	Ñ	ÙÐäÐbÐcpÐbqÐqrÐsÓtÐtr"   c                óZ   •  [        S U  5       5      $ ! [         a    [        S5      ef = f)z_Return the Bounding Boxes in the input.

Assumes only one ``BoundingBoxes`` object is present.
c              3  óh   #   • U  H(  n[        U[        R                  5      (       d  M$  Uv •  M*     g 7fr.   )r   r	   ÚBoundingBoxes©r?   Úinpts     r    rA   Ú%get_bounding_boxes.<locals>.<genexpr>£   s!   é € Ð_¢[˜T´J¸tÄZ×E]ÑE]×4^—D‘D¢[ùó   ‚#2©	2z*No bounding boxes were found in the sample©r\   r[   r   ©Úflat_inputss    r    Úget_bounding_boxesru   œ   s6   € ðGÜÑ_¡[Ó_Ó_Ð_øÜó GÜÐEÓFÐFðGúó   ‚ ”*c                óZ   •  [        S U  5       5      $ ! [         a    [        S5      ef = f)zVReturn the keypoints in the input.

Assumes only one ``KeyPoints`` object is present.
c              3  óh   #   • U  H(  n[        U[        R                  5      (       d  M$  Uv •  M*     g 7fr.   )r   r	   Ú	KeyPointsrn   s     r    rA   Ú get_keypoints.<locals>.<genexpr>¯   s!   é € Ð[¢[˜T´J¸tÄZ×EYÑEY×4Z—D‘D¢[ùrq   z%No keypoints were found in the samplerr   rs   s    r    Úget_keypointsr{   ¨   s6   € ðBÜÑ[¡[Ó[Ó[Ð[øÜó BÜÐ@ÓAÐAðBúrv   c           
     ó¢  • U  Vs1 s Hf  n[        U[        [        R                  [        R                  R                  [        R
                  45      (       d  MR  [        [        U5      5      iMh     nnU(       d  [        S5      e[        U5      S:”  a   [        S[        [        U5      5       35      eUR                  5       u  p4nX4U4$ s  snf )z"Return Channel, Height, and Width.z)No image or video was found in the sampler   z/Found multiple CxHxW dimensions in the sample: )Ú
check_typer   r	   ÚImageÚPILÚVideor)   r   r   r   r   r
   ÚsortedÚpop)rt   ro   ÚchwsÚcÚhÚws         r    Ú	query_chwr‡   ´   s±   € ñ  óâˆDÜ�dœ^¬Z×-=Ñ-=¼s¿y¹y¿¹ÔPZ×P`ÑP`Ða×bó 	$ŒŒn˜TÓ"Ö#Ùð 	ð ö
 ÜÐCÓDÐDÜ	ˆT‹�Q‹ÜÐJÌ?Ô[aÐbfÓ[gÓKhÐJiÐjÓkÐkØ�h‰h‹j�G€Aˆ!Ø�ˆ7€Nùòs   …ACÁCc                óø  • U  Vs1 s H“  n[        U[        [        R                  [        R                  R                  [        R
                  [        R                  [        R                  [        R                  45      (       d  M  [        [        U5      5      iM•     nnU(       d  [        S5      e[        U5      S:”  a   [        S[        [        U5      5       35      eUR!                  5       u  p4X44$ s  snf )zReturn Height and Width.zGNo image, video, mask, bounding box of keypoint was found in the sampler   z-Found multiple HxW dimensions in the sample: )r}   r   r	   r~   r   r€   ÚMaskrm   ry   r)   r   r   r   r   r
   r�   r‚   )rt   ro   Úsizesr…   r†   s        r    Ú
query_sizer‹   Ã   sÍ   € ñ  óâˆDÜØäÜ× Ñ Ü—	‘	—‘Ü× Ñ Ü—‘Ü×(Ñ(Ü×$Ñ$ð÷
ó 	ŒŒh�t‹nÖÙð 
ð ö  ÜÐaÓbÐbÜ	ˆU‹�a‹ÜÐHÌÔY_Ð`eÓYfÓIgÐHhÐiÓjÐjØ�9‰9‹;�D€AØˆ4€Kùò+s   …A>C7ÂC7c                óˆ   • U H<  n[        U[        5      (       a  [        X5      (       d  M*     gU" U 5      (       d  M<    g   g©NTF©r   r   )ÚobjÚtypes_or_checksÚtype_or_checks      r    r}   r}   Ý   s>   € Û(ˆÜ-7¸Ät×-LÑ-LŒ:�c×)Ô)Ùñ S`Ð`c×RdÓRdÙñ )ð r"   c                ó:   • U  H  n[        X!5      (       d  M    g   gr�   )r}   )rt   r�   ro   s      r    Úhas_anyr“   ä   s   € ÛˆÜ�d×,Ó,Ùñ ð r"   c                ó˜   • U HD  nU  H;  n[        U[        5      (       a  [        X25      (       d  M*  OU" U5      (       d  M:    MB       g   g)NFTrŽ   )rt   r�   r‘   ro   s       r    Úhas_allr•   ë   sF   € Û(ˆÛˆDÜ2<¸]ÌD×2QÑ2QŒz˜$×.Ô.ÑWdÐei×WjÓWjÚñ  ñ ñ )ð r"   )r   z#int | float | Sequence[int | float]r   ÚstrÚreturnzSequence[float])r+   ú'_FillType | dict[type | str, _FillType]r—   ÚNone)r+   r   r—   r   )r+   r˜   r—   zdict[type | str, _FillTypeJIT])rD   zint | Sequence[int]r—   r™   )rL   z3Literal['constant', 'edge', 'reflect', 'symmetric']r—   r™   )r^   r   r—   ztorch.Tensor)ri   z!str | Callable[[Any], Any] | Noner—   zCallable[[Any], Any])rt   ú	list[Any]r—   ztv_tensors.BoundingBoxes)rt   rš   r—   ztv_tensors.KeyPoints)rt   rš   r—   ztuple[int, int, int])rt   rš   r—   ztuple[int, int])r�   r   r�   z(tuple[type | Callable[[Any], bool], ...]r—   Úbool)rt   rš   r�   ztype | Callable[[Any], bool]r—   r›   ).Ú
__future__r   Úcollections.abcrX   r'   r   Ú
contextlibr   Útypingr   r   r   Ú	PIL.Imager   ÚtorchÚtorchvisionr	   Útorchvision._utilsr
   Ú!torchvision.transforms.transformsr   r   r   Ú$torchvision.transforms.v2.functionalr   r   r   Ú+torchvision.transforms.v2.functional._utilsr   r   r!   r&   r0   r5   r:   rF   rM   r`   rj   ru   r{   r‡   r‹   r}   r“   r•   rd   r"   r    Ú<module>r§      sŒ   ðÝ "ã Û Ý $Ý ç )Ñ )ã Û å "å .ç ^Ñ ^ß YÑ Yß Oôô(nô
ô3òpô"ô_ô
)!ôXuô	Gô	Bôôô4ôõr"   