
    QЦi>!                        S r SSKJr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Tuple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     ^/var/www/html/ai-image-ml/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)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_sizer9   r:   .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>   r9   listr:   r;   r<   r=   )r   r>   r9   r:   r;   r<   r=   r%   s          r   rA   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=   r:   r;   )r   resizer9   r<   r=   center_cropr>   r   r   r   r   r   r   	normalizer:   r;   r   s     r   r   ImageClassification.forward9   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>   r9   r:   r;   r<   r   format_strings     r   r(   ImageClassification.__repr__B       //#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=``.r9   r<   r>   r:   r;   r'   s    r   r-   ImageClassification.describeL   s]    77;7G7G6HHabfbtbtau v99=8H I??CyykW[W_W_V``ce	
r!   )r=   r>   r<   r:   r9   r;   )r&   r/   r0   r1   r
   BILINEARintr   r   r   boolrA   r   r   r2   r(   r-   r3   __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   U   )gFj?g.5B?g?)gr@H0?gc=yX?gDKK?)r:   r;   r<   r>   r9   r:   .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@   rA   rB   r>   r9   r:   r;   r<   )r   r>   r9   r:   r;   r<   r%   s         r   rA   VideoClassification.__init__V   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   )dimTrF   rG      r         )ndim	unsqueezeshapeviewr   rH   r9   r<   rI   r>   r   r   r   rJ   r:   r;   permutesqueeze)r   rk   need_squeezeNTCHWs           r   r   VideoClassification.forwardf   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$ rM   rT   rU   s     r   r(   VideoClassification.__repr__~   rX   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=r[   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<   r:   r9   r;   )r&   r/   r0   r1   r
   rb   r   rc   r   r   rA   r   r   r2   r(   r-   r3   re   rf   s   @r   r   r   U   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      r7   r8   T)r:   r;   r<   r=   r9   r:   .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@   rA   r9   rB   r:   r;   r<   r=   )r   r9   r:   r;   r<   r=   r%   s         r   rA   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$ rE   )r   r9   rB   r   rH   r<   r=   r   r   r   r   r   rJ   r:   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$ )NrN   rO   rP   rQ   rR   rS   )r%   r&   r9   r:   r;   r<   rU   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	$ )NrZ   r[   r]   r^   r_   )r9   r<   r:   r;   r'   s    r   r-   SemanticSegmentation.describe   sP    77;7G7G6HHabfbtbtau vhhlhqhqgr sXXJc#	
r!   )r=   r<   r:   r9   r;   )r&   r/   r0   r1   r
   rb   r   rc   r   r   rd   rA   r   r   r2   r(   r-   r3   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   rG   )	r   r   r   r   r   r   r   rJ   
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/   r0   r1   r   r   r   r2   r(   r-   r3   r,   r!   r   r   r      s=    F & U66>5J $.# .
# 
r!   r   )__doc__typingr   r   r   r   r   r    r	   r   r
   __all__Moduler   r   r   r   r   r,   r!   r   <module>r      su    * )   0
bii 
 ,
")) ,
^:
")) :
z)
299 )
X
")) 
r!   