ó
    Eñiß?  ã                   ó&  • S SK r S SKrS SKrS SKJr  S SKJrJrJrJ	r	  S SK
rS SKrS SKJr  S SKJrJr  S SKJrJr  S SKJr  SS	KJrJr  SS
KJrJrJrJ r J!r!J"r"   " S S\5      r# " S S\5      r$ " S S\$5      r% " S S\$5      r& " S S\5      r'g)é    N)ÚSequence)ÚAnyÚCallableÚOptionalÚUnion)Úone_hot)Útree_flattenÚtree_unflatten)Ú
transformsÚ
tv_tensors)Ú
functionalé   )Ú_RandomApplyTransformÚ	Transform)Ú_check_sequence_inputÚ_parse_labels_getterÚhas_anyÚis_pure_tensorÚ	query_chwÚ
query_sizec                   óú   ^ • \ rS rSrSr\R                  rS\\	\
4   4U 4S jjr     SS\S\\   S\\   S\S	\4
U 4S
 jjjrS\S\
S\
S\
S\
4
U 4S jjrS\\
   S\\	\
4   4S jrS\
S\\	\
4   S\
4S jrSrU =r$ )ÚRandomErasingé   aî  Randomly select a rectangle region in the input image or video and erase its pixels.

This transform does not support PIL Image.
'Random Erasing Data Augmentation' by Zhong et al. See https://arxiv.org/abs/1708.04896

Args:
    p (float, optional): probability that the random erasing operation will be performed.
    scale (tuple of float, optional): range of proportion of erased area against input image.
    ratio (tuple of float, optional): range of aspect ratio of erased area.
    value (number or tuple of numbers): erasing value. Default is 0. If a single int, it is used to
        erase all pixels. If a tuple of length 3, it is used to erase
        R, G, B channels respectively.
        If a str of 'random', erasing each pixel with random values.
    inplace (bool, optional): boolean to make this transform inplace. Default set to False.

Returns:
    Erased input.

Example:
    >>> from torchvision.transforms import v2 as transforms
    >>>
    >>> transform = transforms.Compose([
    >>>   transforms.RandomHorizontalFlip(),
    >>>   transforms.PILToTensor(),
    >>>   transforms.ConvertImageDtype(torch.float),
    >>>   transforms.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225)),
    >>>   transforms.RandomErasing(),
    >>> ])
Úreturnc                 óf   >• [        [        TU ]	  5       U R                  c  SS9$ U R                  S9$ )NÚrandom)Úvalue)ÚdictÚsuperÚ _extract_params_for_v1_transformr   )ÚselfÚ	__class__s    €Ú_/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torchvision/transforms/v2/_augment.pyr    Ú.RandomErasing._extract_params_for_v1_transform3   s8   ø€ ÜÜ‰GÑ4Ó6Ø"Ÿj™jÑ0�(ñ
ð 	
à6:·j±jñ
ð 	
ó    ÚpÚscaleÚratior   Úinplacec                 ó°  >• [         TU ]  US9  [        U[        R                  [
        [        [        45      (       d  [        S5      e[        U[
        5      (       a  US:w  a  [        S5      e[        U[        5      (       d  [        S5      e[        U[        5      (       d  [        S5      eUS   US   :”  d  US   US   :”  a  [        R                  " S	5        US   S:  d	  US   S:”  a  [        S
5      eX l        X0l        [        U[        [         45      (       a  [!        U5      /U l        O`[        U[
        5      (       a  S U l        OC[        U[        [        45      (       a"  U Vs/ s H  n[!        U5      PM     snU l        OX@l        XPl        [&        R(                  " [&        R*                  " U R                  5      5      U l        g s  snf )N)r&   z=Argument value should be either a number or str or a sequencer   z&If value is str, it should be 'random'zScale should be a sequencezRatio should be a sequencer   r   z,Scale and ratio should be of kind (min, max)zScale should be between 0 and 1)r   Ú__init__Ú
isinstanceÚnumbersÚNumberÚstrÚtupleÚlistÚ	TypeErrorÚ
ValueErrorr   ÚwarningsÚwarnr'   r(   ÚintÚfloatr   r)   ÚtorchÚlogÚtensorÚ
_log_ratio)r!   r&   r'   r(   r   r)   Úvr"   s          €r#   r+   ÚRandomErasing.__init__9   sm  ø€ ô 	‰Ñ˜1ÐÑÜ˜%¤'§.¡.´#´u¼dÐ!C×DÑDÜÐ[Ó\Ð\Ü�eœS×!Ñ! e¨xÓ&7ÜÐEÓFÐFÜ˜%¤×*Ñ*ÜÐ8Ó9Ð9Ü˜%¤×*Ñ*ÜÐ8Ó9Ð9Ø�!‰H�u˜Q‘xÓ U¨1¡X°°a±Ó%8Ü�MŠMÐHÔIØ�‰8�a‹<˜5 ™8 a›<ÜÐ>Ó?Ð?ØŒ
ØŒ
Ü�eœc¤5˜\×*Ñ*Ü ›,˜ˆD�JÜ˜œs×#Ñ#ØˆD�JÜ˜¤¤e˜}×-Ñ-Ù,1Ó2ªE qœ% ž(©EÑ2ˆD�JàŒJØŒäŸ)š)¤E§L¢L°·±Ó$<Ó=ˆ�ùò 3s   Å/Gr   ÚinptÚargsÚkwargsc                 ó,  >• [        U[        R                  [        R                  [        R                  45      (       aB  [
        R                  " [        U 5      R                   S[        U5      R                   S35        [        TU ](  " X/UQ70 UD6$ )Nz:() is currently passing through inputs of type tv_tensors.z(. This will likely change in the future.)r,   r   ÚBoundingBoxesÚ	KeyPointsÚMaskr4   r5   ÚtypeÚ__name__r   Ú_call_kernel)r!   r   r>   r?   r@   r"   s        €r#   rG   ÚRandomErasing._call_kernel\   s}   ø€ Ü�dœZ×5Ñ5´z×7KÑ7KÌZÏ_É_Ð]×^Ñ^Ü�MŠMÜ˜“:×&Ñ&Ð'ð (Ü" 4›j×1Ñ1Ð2Ð2Zð\ôô ‰wÒ# JÐF°tÒF¸vÑFÐFr%   Úflat_inputsc           	      ór  • [        U5      u  p#nU R                  b*  [        U R                  5      SU4;  a  [        SU S35      eX4-  nU R                  n[        S5       GH¾  nU[        R                  " S5      R                  U R                  S   U R                  S   5      R                  5       -  n[        R                  " [        R                  " S5      R                  US   US   5      5      R                  5       n	[        [        [        R                  " X‰-  5      5      5      n
[        [        [        R                  " X‰-  5      5      5      nX£:  a  X´:  d  GM  U R                  c4  [        R                  " X*U/[        R                   S9R#                  5       nO([        R$                  " U R                  5      S S 2S S 4   n[        R&                  " SX:-
  S-   SS9R                  5       n[        R&                  " SXK-
  S-   SS9R                  5       n  O   SSX4S 4u  pÞp«n[)        XÞX«US	9$ )
Nr   z@If value is a sequence, it should have either a single value or z (number of inpt channels)é
   r   )Údtype©r   ©Úsize)ÚiÚjÚhÚwr<   )r   r   Úlenr3   r;   Úranger8   ÚemptyÚuniform_r'   ÚitemÚexpr6   ÚroundÚmathÚsqrtÚfloat32Únormal_r:   Úrandintr   )r!   rI   Úimg_cÚimg_hÚimg_wÚareaÚ	log_ratioÚ_Ú
erase_areaÚaspect_ratiorR   rS   r<   rP   rQ   s                  r#   Úmake_paramsÚRandomErasing.make_paramsd   s×  € Ü'¨Ó4Ñˆ�eà�:‰:Ñ!¤c¨$¯*©*£o¸aÀ¸ZÓ&GÜØRÐSXÐRYÐYsÐtóð ð ‰}ˆà—O‘Oˆ	Ü�r—ˆAØ¤§¢¨A£× 7Ñ 7¸¿
¹
À1¹ÀtÇzÁzÐRSÁ}Ó U× ZÑ ZÓ \Ñ\ˆJÜ Ÿ9š9Ü—’˜A“×'Ñ'Ø˜a‘LØ˜a‘Lóó÷
 ‰d‹fð ô ”Eœ$Ÿ)š) JÑ$=Ó>Ó?Ó@ˆAÜ”Eœ$Ÿ)š) JÑ$=Ó>Ó?Ó@ˆAØ“I !£)Úà�z‰zÑ!Ü—K’K ¨1 ´U·]±]ÑC×KÑKÓM‘ä—L’L §¡Ó,ªQ°°d¨]Ñ;�ä—’˜a ¡¨Q¡°TÑ:×?Ñ?ÓAˆAÜ—’˜a ¡¨Q¡°TÑ:×?Ñ?ÓAˆAÙñ+ ð. ˜q %°Ð4‰MˆA�!˜ä�a ¨!Ñ,Ð,r%   Úparamsc                 ór   • US   b0  U R                   " [        R                  U40 UDSU R                  0D6nU$ )Nr<   r)   )rG   ÚFÚeraser)   ©r!   r>   rj   s      r#   Ú	transformÚRandomErasing.transformŠ   s5   € Ø�#‰;Ñ"Ø×$Ò$¤Q§W¡W¨dÑS°fÑSÀdÇlÁlÒSˆDàˆr%   )r;   r)   r(   r'   r   )ç      à?)g{®Gáz”?g…ëQ¸Õ?)g333333Ó?gffffff
@g        F)rF   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú_transformsr   Ú_v1_transform_clsr   r/   r   r    r7   r   Úboolr+   r   rG   r1   rh   ro   Ú__static_attributes__Ú__classcell__©r"   s   @r#   r   r      sõ   ø† ñð< $×1Ñ1Ðð
°$°s¸C°x±.÷ 
ð Ø!-Ø!+ØØñ!>àð!>ð ˜‰ð!>ð ˜‰ð	!>ð
 ð!>ð ÷!>ð !>ðFG xð G°sð GÀ3ð GÐRUð GÐZ]÷ Gð$- t¨C¡yð $-°T¸#¸s¸(±^ô $-ðL˜cð ¨4°°S°©>ð ¸c÷ ò r%   r   c                   ó´   ^ • \ rS rSrSSSS.S\S\\   SS4U 4S	 jjjrS
 rS\	R                  S\4S jrS\	R                  S\S\	R                  4S jrSrU =r$ )Ú_BaseMixUpCutMixé‘   ç      ð?NÚdefault)ÚalphaÚnum_classesÚlabels_getterr�   r‚   r   c                ó  >• [         TU ]  5         [        U5      U l        [        R
                  R                  [        R                  " U/5      [        R                  " U/5      5      U l        X l	        [        U5      U l        g ©N)r   r+   r7   r�   r8   ÚdistributionsÚBetar:   Ú_distr‚   r   Ú_labels_getter)r!   r�   r‚   rƒ   r"   s       €r#   r+   Ú_BaseMixUpCutMix.__init__’   s^   ø€ Ü‰ÑÔÜ˜5“\ˆŒ
Ü×(Ñ(×-Ñ-¬e¯lªl¸E¸7Ó.CÄUÇ\Â\ÐSXÐRYÓEZÓ[ˆŒ
à&Ôä2°=ÓAˆÕr%   c           	      óÄ  ^	• [        U5      S:”  a  UOUS   n[        U5      u  p#U R                  U5      n[        U[        R
                  R
                  [        R                  [        R                  [        R                  5      (       a!  [        [        U 5      R                   S35      eU R                  U5      m	[        T	[        R                   5      (       d  [        S[        T	5       S35      eT	R"                  S;  a  [        ST	R$                   S35      eT	R"                  S:X  aS  U R&                  bF  T	R$                  S	   U R&                  :w  a)  [        S
T	R$                  S	    SU R&                   S35      eT	R"                  S:X  a  U R&                  c  [        S5      eT	T	R$                  S   S.U R)                  [+        X$5       VVs/ s H  u  pVU(       d  M  UPM     snn5      EnSU[-        U	4S j[/        U5       5       5      '   [+        X$5       VVs/ s H  u  pVU(       a  U R1                  XW5      OUPM!     nnn[3        Xƒ5      $ s  snnf s  snnf )Nr   r   zD() does not support PIL images, bounding boxes, keypoints and masks.z%The labels must be a tensor, but got z	 instead.)r   é   z‹labels should be index based with shape (batch_size,) or probability based with shape (batch_size, num_classes), but got a tensor of shape rŒ   éÿÿÿÿzYWhen passing 2D labels, the number of elements in last dimension must match num_classes: ú != z$. You can Leave num_classes to None.z=num_classes must be passed if the labels are index-based (1D))ÚlabelsÚ
batch_sizeTc              3   ó:   >#   • U  H  u  pUTL d  M  Uv •  M     g 7fr…   © )Ú.0Úidxr>   r�   s      €r#   Ú	<genexpr>Ú+_BaseMixUpCutMix.forward.<locals>.<genexpr>Â   s    øé € Ð!`Ò7M©)¨#ÐQUÐY_ÐQ_§#¡#Ò7Mùs   ƒ’	)rT   r	   Ú_needs_transform_listr   ÚPILÚImager   rB   rD   rC   r3   rE   rF   r‰   r,   r8   ÚTensorÚndimÚshaper‚   rh   ÚzipÚnextÚ	enumeratero   r
   )
r!   ÚinputsrI   ÚspecÚneeds_transform_listr>   Úneeds_transformrj   Úflat_outputsr�   s
            @r#   ÚforwardÚ_BaseMixUpCutMix.forward›   s;  ø€ Ü˜v›;¨›?‘°°q±	ˆÜ(¨Ó0ÑˆØ#×9Ñ9¸+ÓFÐä�;¤§	¡	§¡´×1IÑ1IÌ:Ï?É?Ô\f×\pÑ\p×qÑqÜÜ˜“:×&Ñ&Ð'Ð'kÐlóð ð ×$Ñ$ VÓ,ˆÜ˜&¤%§,¡,×/Ñ/ÜÐDÄTÈ&Ã\ÀNÐR[Ð\Ó]Ð]Ø�;‰;˜fÓ$Üð-à-3¯\©\¨N¸)ðEóð ð
 �;‰;˜!Ó × 0Ñ 0Ñ <ÀÇÁÈbÑAQÐUY×UeÑUeÓAeÜðTà—<‘< Ñ#Ð$ D¨×)9Ñ)9Ð(:ð ;5ð6óð ð �;‰;˜!Ó × 0Ñ 0Ñ 8ÜÐ\Ó]Ð]ð Ø Ÿ,™, q™/ñ
ð ×ÑÜ58¸Ô5[ÔoÒ5[Ñ1˜4Ô_n—Ñ5[Òoóð
ˆð eiÐœTÔ!`´yÀÔ7MÓ!`Ó`Ñaô ,/¨{Ô+Qô
â+QÑ'�ö -<ˆD�N‰N˜4Ô(ÀÒEÙ+Qð 	ñ 
ô
 ˜lÓ1Ð1ùó pùó
s   ÇIÇ$IÈ"&Ir>   r�   c                ó  • [        U[        R                  5      (       a  SOSnUR                  U:w  a  [	        SU SUR                   S35      eUR
                  S   U:w  a  [	        SUR
                  S    SU S	35      eg )
Né   é   zExpected a batched input with z dims, but got z dimensions instead.r   zRThe batch size of the image or video does not match the batch size of the labels: rŽ   Ú.)r,   r   ÚVideor›   r3   rœ   )r!   r>   r�   Úexpected_num_dimss       r#   Ú_check_image_or_videoÚ&_BaseMixUpCutMix._check_image_or_videoÊ   s”   € Ü!+¨D´*×2BÑ2B×!CÑ!C™AÈÐØ�9‰9Ð)Ó)ÜØ0Ð1BÐ0CÀ?ÐSW×S\ÑS\ÐR]Ð]qÐróð ð �:‰:�a‰=˜JÓ&ÜØdØ—:‘:˜a‘=�/  j \°ð4óð ð 'r%   ÚlabelÚlamc                ó"  • UR                   S:X  a  [        XR                  S9nUR                  R                  (       d  UR                  5       nUR                  SS5      R                  SU-
  5      R                  UR                  U5      5      $ )Nr   )r‚   r   r   )
r›   r   r‚   rL   Úis_floating_pointr7   ÚrollÚmul_Úadd_Úmul)r!   r¯   r°   s      r#   Ú_mixup_labelÚ_BaseMixUpCutMix._mixup_labelÖ   sh   € Ø�:‰:˜‹?Ü˜E×/?Ñ/?Ñ@ˆEØ�{‰{×,×,Ø—K‘K“MˆEØ�z‰z˜!˜QÓ×$Ñ$ S¨3¡YÓ/×4Ñ4°U·Y±Y¸s³^ÓDÐDr%   )rˆ   r‰   r�   r‚   )rF   rr   rs   rt   r7   r   r6   r+   r¥   r8   rš   r­   r·   ry   rz   r{   s   @r#   r}   r}   ‘   s}   ø† Ø),È4Ð_hò B ð B¸8ÀC¹=ð BÐmq÷ Bð Bò-2ð^
¨%¯,©,ð 
Àsô 
ðE %§,¡,ð E¸ð EÀ%Ç,Á,÷ Eò Er%   r}   c                   óZ   • \ rS rSrSrS\\   S\\\4   4S jr	S\S\\\4   S\4S jr
S	rg
)ÚMixUpéÞ   aq  Apply MixUp to the provided batch of images and labels.

Paper: `mixup: Beyond Empirical Risk Minimization <https://arxiv.org/abs/1710.09412>`_.

.. note::
    This transform is meant to be used on **batches** of samples, not
    individual images. See
    :ref:`sphx_glr_auto_examples_transforms_plot_cutmix_mixup.py` for detailed usage
    examples.
    The sample pairing is deterministic and done by matching consecutive
    samples in the batch, so the batch needs to be shuffled (this is an
    implementation detail, not a guaranteed convention.)

In the input, the labels are expected to be a tensor of shape ``(batch_size,)``. They will be transformed
into a tensor of shape ``(batch_size, num_classes)``.

Args:
    alpha (float, optional): hyperparameter of the Beta distribution used for mixup. Default is 1.
    num_classes (int, optional): number of classes in the batch. Used for one-hot-encoding.
        Can be None only if the labels are already one-hot-encoded.
    labels_getter (callable or "default", optional): indicates how to identify the labels in the input.
        By default, this will pick the second parameter as the labels if it's a tensor. This covers the most
        common scenario where this transform is called as ``MixUp()(imgs_batch, labels_batch)``.
        It can also be a callable that takes the same input as the transform, and returns the labels.
rI   r   c                 óX   • [        [        U R                  R                  S5      5      S9$ )Nr’   ©r°   )r   r7   rˆ   Úsample)r!   rI   s     r#   rh   ÚMixUp.make_paramsù   s!   € Üœ˜dŸj™j×/Ñ/°Ó3Ó4Ñ5Ð5r%   r>   rj   c                 óì  • US   nXS   L a  U R                  XS9$ [        U[        R                  [        R                  45      (       d  [        U5      (       a™  U R                  XS   S9  UR                  SS5      R                  SU-
  5      R                  UR                  U5      5      n[        U[        R                  [        R                  45      (       a  [        R                  " XAS	9nU$ U$ )
Nr°   r�   r½   r�   ©r�   r   r   r   ©Úlike)r·   r,   r   r™   r«   r   r­   r³   r´   rµ   r¶   Úwrap)r!   r>   rj   r°   Úoutputs        r#   ro   ÚMixUp.transformü   sÐ   € Ø�U‰mˆà˜(Ñ#Ò#Ø×$Ñ$ TÐ$Ð3Ð3Ü˜œz×/Ñ/´×1AÑ1AÐB×CÑCÄ~ÐVZ×G[ÑG[Ø×&Ñ& t¸|Ñ8LÐ&ÑMà—Y‘Y˜q !“_×)Ñ)¨#°©)Ó4×9Ñ9¸$¿(¹(À3»-ÓHˆFä˜$¤×!1Ñ!1´:×3CÑ3CÐ D×EÑEÜ#Ÿš¨Ñ;�àˆMàˆKr%   r’   N©rF   rr   rs   rt   ru   r1   r   r   r/   rh   ro   ry   r’   r%   r#   rº   rº   Þ   sH   † ñð46 t¨C¡yð 6°T¸#¸s¸(±^ô 6ð˜cð ¨4°°S°©>ð ¸c÷ r%   rº   c                   óZ   • \ rS rSrSrS\\   S\\\4   4S jr	S\S\\\4   S\4S jr
S	rg
)ÚCutMixi  aŸ  Apply CutMix to the provided batch of images and labels.

Paper: `CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features
<https://arxiv.org/abs/1905.04899>`_.

.. note::
    This transform is meant to be used on **batches** of samples, not
    individual images. See
    :ref:`sphx_glr_auto_examples_transforms_plot_cutmix_mixup.py` for detailed usage
    examples.
    The sample pairing is deterministic and done by matching consecutive
    samples in the batch, so the batch needs to be shuffled (this is an
    implementation detail, not a guaranteed convention.)

In the input, the labels are expected to be a tensor of shape ``(batch_size,)``. They will be transformed
into a tensor of shape ``(batch_size, num_classes)``.

Args:
    alpha (float, optional): hyperparameter of the Beta distribution used for mixup. Default is 1.
    num_classes (int, optional): number of classes in the batch. Used for one-hot-encoding.
        Can be None only if the labels are already one-hot-encoded.
    labels_getter (callable or "default", optional): indicates how to identify the labels in the input.
        By default, this will pick the second parameter as the labels if it's a tensor. This covers the most
        common scenario where this transform is called as ``CutMix()(imgs_batch, labels_batch)``.
        It can also be a callable that takes the same input as the transform, and returns the labels.
rI   r   c                 ór  • [        U R                  R                  S5      5      n[        U5      u  p4[        R
                  " USS9n[        R
                  " USS9nS[        R                  " SU-
  5      -  n[        Xt-  5      n[        Xs-  5      n	[        [        R                  " XX-
  SS95      n
[        [        R                  " Xi-
  SS95      n[        [        R                  " XX-   US95      n[        [        R                  " Xi-   US95      nX«XÍ4n[        SXÊ-
  XÛ-
  -  XC-  -  -
  5      n[        XïS	9$ )
Nr’   rM   rN   rq   r   r   )Úmin)Úmax)ÚboxÚlam_adjusted)r7   rˆ   r¾   r   r8   r_   r[   r\   r6   Úclampr   )r!   rI   r°   ÚHÚWÚr_xÚr_yÚrÚr_w_halfÚr_h_halfÚx1Úy1Úx2Úy2rÍ   rÎ   s                   r#   rh   ÚCutMix.make_params*  s  € Ü�D—J‘J×%Ñ% bÓ)Ó*ˆä˜+Ó&‰ˆä�mŠm˜A DÑ)ˆÜ�mŠm˜A DÑ)ˆà”$—)’)˜C #™IÓ&Ñ&ˆÜ�q‘u“:ˆÜ�q‘u“:ˆä”—’˜S™^°Ñ3Ó4ˆÜ”—’˜S™^°Ñ3Ó4ˆÜ”—’˜S™^°Ñ3Ó4ˆÜ”—’˜S™^°Ñ3Ó4ˆØ�rÐˆä˜S B¡G°±Ñ#8¸A¹EÑ#BÑBÓCˆä˜Ñ7Ð7r%   r>   rj   c                 óÜ  • XS   L a  U R                  XS   S9$ [        U[        R                  [        R                  45      (       d  [        U5      (       a“  U R                  XS   S9  US   u  p4pVUR                  SS5      nUR                  5       nUS	XF2X524   US	XF2X524'   [        U[        R                  [        R                  45      (       a  [        R                  " X�S
9nU$ U$ )Nr�   rÎ   r½   r�   rÁ   rÍ   r   r   .rÂ   )
r·   r,   r   r™   r«   r   r­   r³   ÚclonerÄ   )	r!   r>   rj   r×   rØ   rÙ   rÚ   ÚrolledrÅ   s	            r#   ro   ÚCutMix.transform@  sç   € Ø˜(Ñ#Ò#Ø×$Ñ$ T°nÑ/EÐ$ÐFÐFÜ˜œz×/Ñ/´×1AÑ1AÐB×CÑCÄ~ÐVZ×G[ÑG[Ø×&Ñ& t¸|Ñ8LÐ&ÑMà# E™]‰NˆB�BØ—Y‘Y˜q !“_ˆFØ—Z‘Z“\ˆFØ(.¨s°B°E¸2¸5Ð/@Ñ(AˆF�3˜˜˜r˜uÐ$Ñ%ä˜$¤×!1Ñ!1´:×3CÑ3CÐ D×EÑEÜ#Ÿš¨Ñ;�àˆMàˆKr%   r’   NrÇ   r’   r%   r#   rÉ   rÉ     sH   † ñð68 t¨C¡yð 8°T¸#¸s¸(±^ô 8ð,˜cð ¨4°°S°©>ð ¸c÷ r%   rÉ   c                   ó†   ^ • \ rS rSrSrS\\\\   4   4U 4S jjrS\	\
   S\\\
4   4S jrS\
S	\\\
4   S\
4S
 jrSrU =r$ )ÚJPEGiS  a  Apply JPEG compression and decompression to the given images.

If the input is a :class:`torch.Tensor`, it is expected
to be of dtype uint8, on CPU, and have [..., 3 or 1, H, W] shape,
where ... means an arbitrary number of leading dimensions.

Args:
    quality (sequence or number): JPEG quality, from 1 to 100. Lower means more compression.
        If quality is a sequence like (min, max), it specifies the range of JPEG quality to
        randomly select from (inclusive of both ends).

Returns:
    image with JPEG compression.
Úqualityc                 ón  >• [         TU ]  5         [        U[        5      (       a$  [        U[        5      (       a  [        S5      eX/nO[        USSS9  SUS   s=::  a  US   s=::  a  S::  a3  O  O0[        US   [        5      (       a  [        US   [        5      (       d  [        SU< 35      eXl        g )	Nzquality can't be boolrâ   )rŒ   )Ú	req_sizesr   r   éd   z7quality must be an integer from 1 to 100, got quality =)	r   r+   r,   r6   rx   r2   r   r3   râ   )r!   râ   r"   s     €r#   r+   ÚJPEG.__init__c  s    ø€ Ü‰ÑÔÜ�gœs×#Ñ#Ü˜'¤4×(Ñ(ÜÐ 7Ó8Ð8ØÐ(‰Gä! '¨9ÀÒEà�W˜Q‘ZÕ4 7¨1¡:Õ4°Ö4¼ÀGÈAÁJÔPS×9TÑ9TÔYcÐdkÐlmÑdnÔps×YtÑYtÜÐWÈgÉ[ÐYÓZÐZà�r%   rI   r   c                 óš   • [         R                  " U R                  S   U R                  S   S-   S5      R                  5       n[	        US9$ )Nr   r   r’   ©râ   )r8   r_   râ   rX   r   )r!   rI   râ   s      r#   rh   ÚJPEG.make_paramsq  s=   € Ü—-’- §¡¨Q¡°·±¸a±À1Ñ1DÀbÓI×NÑNÓPˆÜ˜GÑ$Ð$r%   r>   rj   c                 óD   • U R                  [        R                  XS   S9$ )Nrâ   rè   )rG   rl   Újpegrn   s      r#   ro   ÚJPEG.transformu  s!   € Ø× Ñ ¤§¡¨¸iÑ7HÐ ÐIÐIr%   rè   )rF   rr   rs   rt   ru   r   r6   r   r+   r1   r   r   r/   rh   ro   ry   rz   r{   s   @r#   rá   rá   S  sm   ø† ñð  c¨8°C©=Ð&8Ñ 9÷ ð% t¨C¡yð %°T¸#¸s¸(±^ô %ðJ˜cð J¨4°°S°©>ð J¸c÷ Jò Jr%   rá   )(r[   r-   r4   Úcollections.abcr   Útypingr   r   r   r   Ú	PIL.Imager˜   r8   Útorch.nn.functionalr   Útorch.utils._pytreer	   r
   Útorchvisionr   rv   r   Útorchvision.transforms.v2r   rl   Ú
_transformr   r   Ú_utilsr   r   r   r   r   r   r   r}   rº   rÉ   rá   r’   r%   r#   Ú<module>rö      s   ðÛ Û Û Ý $ß 1Ó 1ã Û Ý 'ß <ß =Ý 5ç 8ß o× oô|Ð)ô |ô~JE�yô JEôZ-Ðô -ô`BÐô BôJ#Jˆ9õ #Jr%   