ó
    Eñi8!  ã                   ó  • S r SSKJrJr  SSKrSSKJrJr  SSKJr	J
r
  / SQr " S S	\R                  5      r " S
 S\R                  5      r " S S\R                  5      r " S S\R                  5      r " S S\R                  5      rg)zÙ
This file is part of the private API. Please do not use directly these classes as they will be modified on
future versions without warning. The classes should be accessed only via the transforms argument of Weights.
é    )ÚOptionalÚUnionN)ÚnnÚTensoré   )Ú
functionalÚInterpolationMode)ÚObjectDetectionÚImageClassificationÚVideoClassificationÚSemanticSegmentationÚOpticalFlowc                   óB   • \ rS rSrS\S\4S jrS\4S jrS\4S jrSr	g)	r
   é   ÚimgÚreturnc                 ó¢   • [        U[        5      (       d  [        R                  " U5      n[        R                  " U[
        R                  5      $ ©N)Ú
isinstancer   ÚFÚpil_to_tensorÚconvert_image_dtypeÚtorchÚfloat©Úselfr   s     Ú\/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torchvision/transforms/_presets.pyÚforwardÚObjectDetection.forward   s4   € Ü˜#œv×&Ñ&Ü—/’/ #Ó&ˆCÜ×$Ò$ S¬%¯+©+Ó6Ð6ó    c                 ó4   • U R                   R                  S-   $ ©Nz()©Ú	__class__Ú__name__©r   s    r   Ú__repr__ÚObjectDetection.__repr__   ó   € Ø�~‰~×&Ñ&¨Ñ-Ð-r    c                 ó   •  g)Nz“Accepts ``PIL.Image``, batched ``(B, C, H, W)`` and single ``(C, H, W)`` image ``torch.Tensor`` objects. The images are rescaled to ``[0.0, 1.0]``.© r&   s    r   ÚdescribeÚObjectDetection.describe    s   € ð9ð	
r    r+   N)
r%   Ú
__module__Ú__qualname__Ú__firstlineno__r   r   Ústrr'   r,   Ú__static_attributes__r+   r    r   r
   r
      s-   † ð7˜6ð 7 fô 7ð
.˜#ô .ð
˜#÷ 
r    r
   c                   ó´   ^ • \ rS rSrSSS\R
                  SS.S\S\S	\\S
4   S\\S
4   S\S\	\
   SS4U 4S jjjrS\S\4S jrS\4S jrS\4S jrSrU =r$ )r   é'   é   ©g
×£p=
ß?gÉv¾Ÿ/Ý?g–C‹lçûÙ?©gZd;ßOÍ?gyé&1¬Ì?gÍÌÌÌÌÌÌ?T)Úresize_sizeÚmeanÚstdÚinterpolationÚ	antialiasÚ	crop_sizer8   r9   .r:   r;   r<   r   Nc                óš   >• [         TU ]  5         U/U l        U/U l        [	        U5      U l        [	        U5      U l        XPl        X`l        g r   )	ÚsuperÚ__init__r=   r8   Úlistr9   r:   r;   r<   )r   r=   r8   r9   r:   r;   r<   r$   s          €r   r@   ÚImageClassification.__init__(   sD   ø€ ô 	‰ÑÔØ#˜ˆŒØ'˜=ˆÔÜ˜“JˆŒ	Ü˜“9ˆŒØ*ÔØ"�r    r   c                 ó   • [         R                  " XR                  U R                  U R                  S9n[         R
                  " XR                  5      n[        U[        5      (       d  [         R                  " U5      n[         R                  " U[        R                  5      n[         R                  " XR                  U R                  S9nU$ ©N©r;   r<   ©r9   r:   )r   Úresizer8   r;   r<   Úcenter_cropr=   r   r   r   r   r   r   Ú	normalizer9   r:   r   s     r   r   ÚImageClassification.forward:   s‡   € Ü�hŠh�s×,Ñ,¸D×<NÑ<NÐZ^×ZhÑZhÑiˆÜ�mŠm˜C§¡Ó0ˆÜ˜#œv×&Ñ&Ü—/’/ #Ó&ˆCÜ×#Ò# C¬¯©Ó5ˆÜ�kŠk˜#§I¡I°4·8±8Ñ<ˆØˆ
r    c                 óö   • U R                   R                  S-   nUSU R                   3-  nUSU R                   3-  nUSU R                   3-  nUSU R
                   3-  nUSU R                   3-  nUS-  nU$ ©NÚ(z
    crop_size=ú
    resize_size=ú

    mean=ú	
    std=ú
    interpolation=ú
)©r$   r%   r=   r8   r9   r:   r;   ©r   Úformat_strings     r   r'   ÚImageClassification.__repr__C   ó™   € ØŸ™×/Ñ/°#Ñ5ˆØÐ+¨D¯N©NÐ+;Ð<Ñ<ˆØÐ-¨d×.>Ñ.>Ð-?Ð@Ñ@ˆØ˜; t§y¡y kÐ2Ñ2ˆØ˜: d§h¡h ZÐ0Ñ0ˆØÐ/°×0BÑ0BÐ/CÐDÑDˆØ˜ÑˆØÐr    c                 óŠ   • SU R                    SU R                   SU R                   SU R                   SU R                   S3$ )Nú‘Accepts ``PIL.Image``, batched ``(B, C, H, W)`` and single ``(C, H, W)`` image ``torch.Tensor`` objects. The images are resized to ``resize_size=ú`` using ``interpolation=ú.``, followed by a central crop of ``crop_size=ú]``. Finally the values are first rescaled to ``[0.0, 1.0]`` and then normalized using ``mean=ú`` and ``std=ú``.©r8   r;   r=   r9   r:   r&   s    r   r,   ÚImageClassification.describeM   s]   € ð7Ø7;×7GÑ7GÐ6HÐHaÐbf×btÑbtÐauð v9Ø9=¿¹Ð8Hð I?Ø?C¿y¹y¸kÈÐW[×W_ÑW_ÐV`Ð`cðeð	
r    )r<   r=   r;   r9   r8   r:   )r%   r.   r/   r0   r	   ÚBILINEARÚintÚtupler   r   Úboolr@   r   r   r1   r'   r,   r2   Ú__classcell__©r$   s   @r   r   r   '   s°   ø† ð
 Ø"7Ø!6Ø+<×+EÑ+EØ$(ò#ð ð#ð ð	#ð
 �E˜3�JÑð#ð �5˜#�:Ñð#ð )ð#ð ˜D‘>ð#ð 
÷#ð #ð$˜6ð  fô ð˜#ô ð
˜#÷ 
ò 
r    r   c                   óÊ   ^ • \ rS rSrSS\R
                  S.S\\\4   S\\\   \\\4   4   S\\	S4   S	\\	S4   S
\SS4U 4S jjjr
S\S\4S jrS\4S jrS\4S jrSrU =r$ )r   éV   )gFë¨j‚¨Û?gñõµ.5BÙ?g�¥½ÁØ?)grá@H0Í?gcÙ=yXÌ?gD¾K©KÆË?)r9   r:   r;   r=   r8   r9   .r:   r;   r   Nc                ó®   >• [         TU ]  5         [        U5      U l        [        U5      U l        [        U5      U l        [        U5      U l        XPl        g r   )r?   r@   rA   r=   r8   r9   r:   r;   )r   r=   r8   r9   r:   r;   r$   s         €r   r@   ÚVideoClassification.__init__W   sD   ø€ ô 	‰ÑÔÜ˜i›ˆŒÜ Ó,ˆÔÜ˜“JˆŒ	Ü˜“9ˆŒØ*Õr    Úvidc                 óZ  • SnUR                   S:  a  UR                  SS9nSnUR                  u  p4pVnUR                  SXVU5      n[        R
                  " XR                  U R                  SS9n[        R                  " XR                  5      n[        R                  " U[        R                  5      n[        R                  " XR                  U R                  S9nU R                  u  pgUR                  X4XVU5      nUR!                  SS	S
SS5      nU(       a  UR#                  SS9nU$ )NFé   r   )ÚdimTéÿÿÿÿrE   rF   é   r   é   é   )ÚndimÚ	unsqueezeÚshapeÚviewr   rG   r8   r;   rH   r=   r   r   r   rI   r9   r:   ÚpermuteÚsqueeze)r   rk   Úneed_squeezeÚNÚTÚCÚHÚWs           r   r   ÚVideoClassification.forwardg   sô   € ØˆØ�8‰8�a‹<Ø—-‘- A�-Ð&ˆCØˆLàŸ	™	‰ˆˆa�AØ�h‰h�r˜1 Ó#ˆô
 �hŠh�s×,Ñ,¸D×<NÑ<NÐZ_Ñ`ˆÜ�mŠm˜C§¡Ó0ˆÜ×#Ò# C¬¯©Ó5ˆÜ�kŠk˜#§I¡I°4·8±8Ñ<ˆØ�~‰~‰ˆØ�h‰h�q˜Q 1Ó%ˆØ�k‰k˜!˜Q  1 aÓ(ˆæØ—+‘+ !�+Ð$ˆCØˆ
r    c                 óö   • U R                   R                  S-   nUSU R                   3-  nUSU R                   3-  nUSU R                   3-  nUSU R
                   3-  nUSU R                   3-  nUS-  nU$ rL   rS   rT   s     r   r'   ÚVideoClassification.__repr__   rW   r    c                 óŠ   • SU R                    SU R                   SU R                   SU R                   SU R                   S3$ )NzŽAccepts batched ``(B, T, C, H, W)`` and single ``(T, C, H, W)`` video frame ``torch.Tensor`` objects. The frames are resized to ``resize_size=rZ   r[   r\   r]   zP``. Finally the output dimensions are permuted to ``(..., C, T, H, W)`` tensors.r_   r&   s    r   r,   ÚVideoClassification.describe‰   sa   € ð7Ø7;×7GÑ7GÐ6HÐHaÐbf×btÑbtÐauð v9Ø9=¿¹Ð8Hð I?Ø?C¿y¹y¸kÈÐW[×W_ÑW_ÐV`ð aHðHð	
r    )r=   r;   r9   r8   r:   )r%   r.   r/   r0   r	   ra   rc   rb   r   r   r@   r   r   r1   r'   r,   r2   re   rf   s   @r   r   r   V   sº   ø† ð #?Ø!=Ø+<×+EÑ+Eò+ð ˜˜c˜‘?ð+ð ˜5 ™: u¨S°#¨X¡Ð6Ñ7ð	+ð
 �E˜3�JÑð+ð �5˜#�:Ñð+ð )ð+ð 
÷+ð +ð ˜6ð  fô ð0˜#ô ð
˜#÷ 
ò 
r    r   c                   ó´   ^ • \ rS rSrSS\R
                  SS.S\\   S\\	S4   S	\\	S4   S
\S\\
   SS4U 4S jjjrS\S\4S jrS\4S jrS\4S jrSrU =r$ )r   é“   r6   r7   T)r9   r:   r;   r<   r8   r9   .r:   r;   r<   r   Nc                ó”   >• [         TU ]  5         Ub  U/OS U l        [        U5      U l        [        U5      U l        X@l        XPl        g r   )r?   r@   r8   rA   r9   r:   r;   r<   )r   r8   r9   r:   r;   r<   r$   s         €r   r@   ÚSemanticSegmentation.__init__”   sB   ø€ ô 	‰ÑÔØ,7Ñ,C˜K™=ÈˆÔÜ˜“JˆŒ	Ü˜“9ˆŒØ*ÔØ"�r    r   c                 óž  • [        U R                  [        5      (       a4  [        R                  " XR                  U R
                  U R                  S9n[        U[        5      (       d  [        R                  " U5      n[        R                  " U[        R                  5      n[        R                  " XR                  U R                  S9nU$ rD   )r   r8   rA   r   rG   r;   r<   r   r   r   r   r   rI   r9   r:   r   s     r   r   ÚSemanticSegmentation.forward¤   sˆ   € Ü�d×&Ñ&¬×-Ñ-Ü—(’(˜3× 0Ñ 0À×@RÑ@RÐ^b×^lÑ^lÑmˆCÜ˜#œv×&Ñ&Ü—/’/ #Ó&ˆCÜ×#Ò# C¬¯©Ó5ˆÜ�kŠk˜#§I¡I°4·8±8Ñ<ˆØˆ
r    c                 óÒ   • U R                   R                  S-   nUSU R                   3-  nUSU R                   3-  nUSU R                   3-  nUSU R
                   3-  nUS-  nU$ )NrM   rN   rO   rP   rQ   rR   )r$   r%   r8   r9   r:   r;   rT   s     r   r'   ÚSemanticSegmentation.__repr__­   s‚   € ØŸ™×/Ñ/°#Ñ5ˆØÐ-¨d×.>Ñ.>Ð-?Ð@Ñ@ˆØ˜; t§y¡y kÐ2Ñ2ˆØ˜: d§h¡h ZÐ0Ñ0ˆØÐ/°×0BÑ0BÐ/CÐDÑDˆØ˜ÑˆØÐr    c           	      óp   • SU R                    SU R                   SU R                   SU R                   S3	$ )NrY   rZ   r\   r]   r^   )r8   r;   r9   r:   r&   s    r   r,   ÚSemanticSegmentation.describe¶   sP   € ð7Ø7;×7GÑ7GÐ6HÐHaÐbf×btÑbtÐauð vhØhl×hqÑhqÐgrð sØ—X‘X�J˜cð#ð	
r    )r<   r;   r9   r8   r:   )r%   r.   r/   r0   r	   ra   r   rb   rc   r   rd   r@   r   r   r1   r'   r,   r2   re   rf   s   @r   r   r   “   s§   ø† ð
 #8Ø!6Ø+<×+EÑ+EØ$(ò#ð ˜c‘]ð#ð �E˜3�JÑð	#ð
 �5˜#�:Ñð#ð )ð#ð ˜D‘>ð#ð 
÷#ð #ð ˜6ð  fô ð˜#ô ð
˜#÷ 
ò 
r    r   c                   óP   • \ rS rSrS\S\S\\\4   4S jrS\4S jrS\4S jr	Sr
g	)
r   é¿   Úimg1Úimg2r   c                 óð  • [        U[        5      (       d  [        R                  " U5      n[        U[        5      (       d  [        R                  " U5      n[        R                  " U[
        R                  5      n[        R                  " U[
        R                  5      n[        R                  " U/ SQ/ SQS9n[        R                  " U/ SQ/ SQS9nUR                  5       nUR                  5       nX4$ )N)ç      à?r“   r“   rF   )	r   r   r   r   r   r   r   rI   Ú
contiguous)r   r�   r‘   s      r   r   ÚOpticalFlow.forwardÀ   sª   € Ü˜$¤×'Ñ'Ü—?’? 4Ó(ˆDÜ˜$¤×'Ñ'Ü—?’? 4Ó(ˆDä×$Ò$ T¬5¯;©;Ó7ˆÜ×$Ò$ T¬5¯;©;Ó7ˆô �{Š{˜4¢oº?ÑKˆÜ�{Š{˜4¢oº?ÑKˆà�‰Ó ˆØ�‰Ó ˆàˆzÐr    c                 ó4   • U R                   R                  S-   $ r"   r#   r&   s    r   r'   ÚOpticalFlow.__repr__Ò   r)   r    c                 ó   •  g)Nz”Accepts ``PIL.Image``, batched ``(B, C, H, W)`` and single ``(C, H, W)`` image ``torch.Tensor`` objects. The images are rescaled to ``[-1.0, 1.0]``.r+   r&   s    r   r,   ÚOpticalFlow.describeÕ   s   € ð:ð	
r    r+   N)r%   r.   r/   r0   r   rc   r   r1   r'   r,   r2   r+   r    r   r   r   ¿   s=   † ð˜Fð ¨&ð °U¸6À6¸>Ñ5Jô ð$.˜#ô .ð
˜#÷ 
r    r   )Ú__doc__Útypingr   r   r   r   r   Ú r   r   r	   Ú__all__ÚModuler
   r   r   r   r   r+   r    r   Ú<module>rŸ      sr   ðñ÷
 #ã ß ç 0ò€ô
�b—i‘iô 
ô ,
˜"Ÿ)™)ô ,
ô^:
˜"Ÿ)™)ô :
ôz)
˜2Ÿ9™9ô )
ôX
�"—)‘)õ 
r    