
    h8!                        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     W/var/www/auris/envauris/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)NzAccepts ``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-    76 7f 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=
?gv/?gCl?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    hhs,,D<N<NZ^ZhZhimmC0#v&&//#&C##C5kk#II488<
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+DNN+;<<-d.>.>-?@@;tyyk22:dhhZ00/0B0B/CDDr    c                     SU R                    SU R                   SU R                   SU R                   SU R                   S3$ )NAccepts ``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]    77;7G7G6HHabfbtbtau v99=8H I??Cyyk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$(# # 	#
 E3J# 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   )gFj?g.5B?g?)gr@H0?gc=yX?gDKK?)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   )dimTrE   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    88a<--A-&CL		aAhhr1#
 hhs,,D<N<NZ_`mmC0##C5kk#II488<~~hhqQ1%kk!Q1a(++!+$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$ )NzAccepts 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    77;7G7G6HHabfbtbtau v99=8H I??Cyyk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:uS#X67	+
 E3J+ 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,CK=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mC#v&&//#&C##C5kk#II488<
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.>.>-?@@;tyyk22:dhhZ00/0B0B/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    77;7G7G6HHabfbtbtau vhhlhqhqgr sXXJc#	
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]# E3J	#
 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$$T5;;7$$T5;;7 {{4o?K{{4o?K  zr    c                 4    U R                   R                  S-   $ r"   r#   r&   s    r   r'   OpticalFlow.__repr__   r)   r    c                      g)NzAccepts ``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 & U66>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
bii 
 ,
")) ,
^:
")) :
z)
299 )
X
")) 
r    