+
    ûäûj?ƒ  ã                   ó‚  € R t ^ RIHtHtHtHt ^ RIt^ RIHt	 ^ RI
Ht ^ RIHt ^ RIHt ^ RIHt ^ RIHtHt ^ RIHtHtHt R	 R
 lt. R7Ot ! R R]4      t ! R  R!]4      t ! R" R#]4      t ! R$ R]4      t ! R% R]4      t ! R& R]4      t  ! R' R]4      t! ! R( R]4      t" ! R) R]4      t# ! R* R]4      t$ ! R+ R]4      t% ! R, R]4      t& ! R- R]4      t' ! R. R]4      t( ! R/ R]4      t) ! R0 R]4      t* ! R1 R]4      t+ ! R2 R]4      t, ! R3 R]4      t- ! R4 R]4      t. ! R5 R]4      t/ ! R6 R]4      t0R# )8aA  Implement color and geometric operations used by automatic augmentation policies.

Which class to use:

- :class:`AutoContrast`, :class:`Equalize`, :class:`Contrast`, :class:`Brightness`, :class:`Hue`,
  :class:`Saturate` and :class:`Gray` change image tone or color.
- :class:`Invert`, :class:`Posterize`, :class:`Solarize`, :class:`SolarizeAdd` and :class:`Sharpness` change values
  or local appearance.
- :class:`HorizontalFlip`, :class:`VerticalFlip`, :class:`Rotate`, :class:`ShearX`, :class:`ShearY`,
  :class:`TranslateX` and :class:`TranslateY` change image geometry.
)ÚAnyÚDictÚOptionalÚTupleN)ÚRandomBrightness)ÚRandomContrast)ÚRandomSaturation)ÚOperationBase)Ú_clamp_unit_rangeÚ_to_device_nonblocking)Úadjust_brightness_accumulativeÚ%adjust_contrast_with_mean_subtractionÚ'adjust_saturation_with_gray_subtractionc                ó�   € V ^8„  d   QhR\         \        P                  ,          R\        R\         \        P                  ,          /# )é   ÚmagÚsizeÚreturn)r   ÚtorchÚTensorÚint)Úformats   "ÚcC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\kornia\augmentation\auto\operations\ops.pyÚ__annotate__r   .   s3   € ÷ /ñ /œX¤e§l¡lÕ3ð /¼3ð /Ä8ÌEÏLÉLÕCYñ /ó    c                 ó   € V f   R # W,          # ©N© )r   r   s   &&r   Ú_fraction_to_pixelsr   .   s   € ð ’;ˆ4Ð. C¥JÐ.r   ÚAutoContrastÚ
BrightnessÚContrastÚEqualizeÚGrayÚHorizontalFlipÚHueÚInvertÚ	PosterizeÚRotateÚSaturateÚ	SharpnessÚShearXÚShearYÚSolarizeÚSolarizeAddÚ
TranslateXÚ
TranslateYÚVerticalFlipc                   ó6   a € ] tR t^Kt o RV 3R lR lltRtV tR# )Ú_PILBrightnessNc          
      óÄ   <€ V ^8„  d   QhRS[ P                  RS[S[S[ P                  3,          RS[S[S[3,          RS[S[ P                  ,          RS[ P                  /# ©r   ÚinputÚparamsÚflagsÚ	transformr   ©r   r   r   Ústrr   r   )r   Ú__classdict__s   "€r   r   Ú_PILBrightness.__annotate__L   sk   ø€ ÷ 	Pñ 	Pá�|‰|ð	Pñ ‘S™%Ÿ,™,Ð&Õ'ð	Pñ ‘C™�H�~ð		Pñ
 ™EŸL™LÕ)ð	Pñ 
�‰ñ	Pr   c                ó|   € \        VR,          VP                  VP                  4      p\        \	        V4      V4      # )ú<Apply the sampled PIL-style enhancement factor to the input.Úbrightness_factor)r   ÚdeviceÚdtyper   r
   ©Úselfr6   r7   r8   r9   Úfactors   &&&&& r   Úapply_transformÚ_PILBrightness.apply_transformL   s6   € ô (¨Ð/BÕ(CÀUÇ\Á\ÐSX×S^ÑS^Ó_ˆÜ-Ô.?ÀÓ.FÈÓOÐOr   r   r   ©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__rF   Ú__static_attributes__Ú__classdictcell__©r<   s   @r   r3   r3   K   s   ø‡ € ÷	P÷ 	Pð 	Pr   r3   c                   ó6   a € ] tR t^Xt o RV 3R lR lltRtV tR# )Ú_PILContrastNc          
      óÄ   <€ V ^8„  d   QhRS[ P                  RS[S[S[ P                  3,          RS[S[S[3,          RS[S[ P                  ,          RS[ P                  /# r5   r:   )r   r<   s   "€r   r   Ú_PILContrast.__annotate__Y   sk   ø€ ÷ 	Wñ 	Wá�|‰|ð	Wñ ‘S™%Ÿ,™,Ð&Õ'ð	Wñ ‘C™�H�~ð		Wñ
 ™EŸL™LÕ)ð	Wñ 
�‰ñ	Wr   c                ó|   € \        VR,          VP                  VP                  4      p\        \	        V4      V4      # )r?   Úcontrast_factor)r   rA   rB   r   r
   rC   s   &&&&& r   rF   Ú_PILContrast.apply_transformY   s6   € ô (¨Ð/@Õ(AÀ5Ç<Á<ÐQV×Q\ÑQ\Ó]ˆÜ4Ô5FÀuÓ5MÈvÓVÐVr   r   r   rH   rO   s   @r   rQ   rQ   X   s   ø‡ € ÷	W÷ 	Wð 	Wr   rQ   c                   ó6   a € ] tR t^et o RV 3R lR lltRtV tR# )Ú_PILSaturationNc          
      óÄ   <€ V ^8„  d   QhRS[ P                  RS[S[S[ P                  3,          RS[S[S[3,          RS[S[ P                  ,          RS[ P                  /# r5   r:   )r   r<   s   "€r   r   Ú_PILSaturation.__annotate__f   sk   ø€ ÷ 	Yñ 	Yá�|‰|ð	Yñ ‘S™%Ÿ,™,Ð&Õ'ð	Yñ ‘C™�H�~ð		Yñ
 ™EŸL™LÕ)ð	Yñ 
�‰ñ	Yr   c                ó|   € \        VR,          VP                  VP                  4      p\        \	        V4      V4      # )r?   Úsaturation_factor)r   rA   rB   r   r
   rC   s   &&&&& r   rF   Ú_PILSaturation.apply_transformf   s7   € ô (¨Ð/BÕ(CÀUÇ\Á\ÐSX×S^ÑS^Ó_ˆÜ6Ô7HÈÓ7OÐQWÓXÐXr   r   r   rH   rO   s   @r   rX   rX   e   s   ø‡ € ÷	Y÷ 	Yð 	Yr   rX   c                   óF   a a€ ] tR t^rt oRtRV3R lV 3R llltRtVtV ;t# )r   aA  Stretch each image channel's occupied range to the full value range.

``output = AutoContrast(probability)(input)`` stretches each selected channel's occupied range in a floating
``(B, C, H, W)`` batch toward ``[0, 1]``.

Args:
    initial_probability: probability of applying the operation to each image.
    temperature: retained for API compatibility.
    symmetric_megnitude: if to randomly assign the magnitude as negative or not.

See Also:
    - :class:`~kornia.augmentation.auto.operations.ops.Contrast` : changes contrast by blending toward the grayscale
      mean.

c                ó0   <€ V ^8„  d   QhRS[ RS[ RS[RR/# )r   Úinitial_probabilityÚtemperatureÚsymmetric_megnituder   N)ÚfloatÚbool)r   r<   s   "€r   r   ÚAutoContrast.__annotate__ƒ   s-   ø€ ÷ 
ñ 
Ù#(ð
Ù=Bð
Ù_cð
à	ñ
r   c                óZ   <€ \         SV `  \        P                  ! R VR7      RVVR7       R# ©F©Úsame_on_batchÚpN©Úinitial_magnitudera   rb   )ÚsuperÚ__init__ÚKÚRandomAutoContrast)rD   r`   ra   rb   Ú	__class__s   &&&&€r   rn   ÚAutoContrast.__init__ƒ   s1   ø€ ô 	‰ÑÜ× Ò ¨uÐ8KÔLØ"Ø#Ø 3ð	 	ö 	
r   r   )ç      à?çš™™™™™¹?F©	rI   rJ   rK   rL   Ú__doc__rn   rM   rN   Ú__classcell__©rq   r<   s   @@r   r   r   r   s   ù‡ € ñ÷ 
÷ 
õ 
r   c                   óF   a a€ ] tR t^Žt oRtRV3R lV 3R llltRtVtV ;t# )r    aT  Apply PIL-style multiplicative brightness for automatic augmentation.

``output = Brightness(magnitude, probability)(input)`` multiplies selected images in a floating ``(B, C, H, W)``
batch by the magnitude and keeps the shape. Inputs are clamped into ``[0, 1]`` before adjustment, as are outputs;
use :class:`~kornia.augmentation.RandomBrightness` for additive brightness.

Args:
    initial_probability: probability of applying the operation to each image.
    initial_magnitude: the initial magnitude.
    magnitude_range: the sampling range for random sampling and clamping the optimized magnitude.
    temperature: retained for API compatibility.
    symmetric_megnitude: if to randomly assign the magnitude as negative or not.

See Also:
    - :class:`~kornia.augmentation.auto.operations.ops.Contrast`: changes contrast rather than brightness.

c                ób   <€ V ^8„  d   QhRS[ S[,          RS[RS[S[S[3,          RS[RS[RR/# ©r   rl   r`   Úmagnitude_rangera   rb   r   N©r   rc   r   rd   )r   r<   s   "€r   r   ÚBrightness.__annotate__¡   óT   ø€ ÷ 
ñ 
á#¡E�?ð
ñ #ð
ñ ™u¡e˜|Õ,ð	
ñ
 ð
ñ "ð
ð 
ñ
r   c                óL   <€ \         SV `  \        VR VR7      RV3.VVR7       R# )Frh   r@   rk   N)rm   rn   r3   ©rD   rl   r`   r|   ra   rb   rq   s   &&&&&&€r   rn   ÚBrightness.__init__¡   ó6   ø€ ô 	‰ÑÜ˜?¸%ÐCVÔWØ 3Ð5FÐGÐHØ#Ø 3ð	 	ö 	
r   r   ©rs   rs   )çš™™™™™É?gÍÌÌÌÌÌü?rt   Fru   rx   s   @@r   r    r    Ž   s   ù‡ € ñ÷$
÷ 
õ 
r   c                   óF   a a€ ] tR t^±t oRtRV3R lV 3R llltRtVtV ;t# )r!   aœ  Apply PIL-style contrast by blending each image towards its mean grayscale value.

``output = Contrast(magnitude, probability)(input)`` scales selected floating images ``(B, C, H, W)`` around their
mean. RGB inputs use the grayscale mean; other channel counts use the mean over all channels and pixels. Selected
inputs and outputs are clamped into ``[0, 1]``; use :class:`~kornia.augmentation.RandomContrast` for direct
multiplication instead.

Args:
    initial_probability: probability of applying the operation to each image.
    initial_magnitude: the initial magnitude.
    magnitude_range: the sampling range for random sampling and clamping the optimized magnitude.
    temperature: retained for API compatibility.
    symmetric_megnitude: if to randomly assign the magnitude as negative or not.

See Also:
    - :class:`~kornia.augmentation.auto.operations.ops.Brightness`: changes brightness rather than contrast.

c                ób   <€ V ^8„  d   QhRS[ S[,          RS[RS[S[S[3,          RS[RS[RR/# r{   r}   )r   r<   s   "€r   r   ÚContrast.__annotate__Å   r   r   c                óL   <€ \         SV `  \        VR VR7      RV3.VVR7       R# )Frh   rU   rk   N)rm   rn   rQ   r�   s   &&&&&&€r   rn   ÚContrast.__init__Å   s6   ø€ ô 	‰ÑÜ˜¸ÐATÔUØ 1Ð3DÐEÐFØ#Ø 3ð	 	ö 	
r   r   r„   ru   rx   s   @@r   r!   r!   ±   ó   ù‡ € ñ÷&
÷ 
õ 
r   c                   óF   a a€ ] tR t^Õt oRtRV3R lV 3R llltRtVtV ;t# )r%   aã  Shift hue by a policy-controlled amount.

``output = Hue(magnitude, probability)(input)`` shifts hue in a floating RGB batch ``(B, 3, H, W)`` and keeps its
shape. The magnitude is a fraction of a full hue turn. Selected inputs and outputs are clamped to ``[0, 1]``.

Args:
    initial_probability: probability of applying the operation to each image.
    initial_magnitude: the initial magnitude.
    magnitude_range: the sampling range for random sampling and clamping the optimized magnitude.
    temperature: retained for API compatibility.
    symmetric_megnitude: if to randomly assign the magnitude as negative or not.

See Also:
    - :class:`~kornia.augmentation.auto.operations.ops.Saturate`: adjusts saturation rather than hue.

c                ób   <€ V ^8„  d   QhRS[ S[,          RS[RS[S[S[3,          RS[RS[RR/# r{   r}   )r   r<   s   "€r   r   ÚHue.__annotate__ç   r   r   c                ób   <€ \         SV `  \        P                  ! VR VR7      RV3.VVR7       R# )Frh   Ú
hue_factorrk   N)rm   rn   ro   Ú	RandomHuer�   s   &&&&&&€r   rn   ÚHue.__init__ç   s:   ø€ ô 	‰ÑÜ�KŠK˜°uÐ@SÔTØ ,Ð.?Ð@ÐAØ#Ø 3ð	 	ö 	
r   r   )ç        rs   )g      à¿rs   rt   Fru   rx   s   @@r   r%   r%   Õ   ó   ù‡ € ñ÷"
÷ 
õ 
r   c                   óF   a a€ ] tR t^÷t oRtRV3R lV 3R llltRtVtV ;t# )r)   a  Apply PIL-style color enhancement by blending with grayscale.

``output = Saturate(magnitude, probability)(input)`` blends selected floating images ``(B, C, H, W)`` with their
grayscale versions. One or three channels are accepted; grayscale inputs only undergo the ``[0, 1]`` input/output
clamps.

Unlike :class:`~kornia.augmentation.RandomSaturation`, this blends RGB
values with grayscale rather than scaling HSV saturation.

Args:
    initial_probability: probability of applying the operation to each image.
    initial_magnitude: the initial magnitude.
    magnitude_range: the sampling range for random sampling and clamping the optimized magnitude.
    temperature: retained for API compatibility.
    symmetric_megnitude: if to randomly assign the magnitude as negative or not.

See Also:
    - :class:`~kornia.augmentation.auto.operations.ops.Hue`: shifts hue rather than saturation.

c                ób   <€ V ^8„  d   QhRS[ S[,          RS[RS[S[S[3,          RS[RS[RR/# r{   r}   )r   r<   s   "€r   r   ÚSaturate.__annotate__  r   r   c                óL   <€ \         SV `  \        VR VR7      RV3.VVR7       R# )Frh   r\   rk   N)rm   rn   rX   r�   s   &&&&&&€r   rn   ÚSaturate.__init__  rƒ   r   r   r„   ru   rx   s   @@r   r)   r)   ÷   s   ù‡ € ñ÷*
÷ 
õ 
r   c                   óF   a a€ ] tR tRt oRtRV3R lV 3R llltRtVtV ;t# )r"   i  aB  Equalize image histograms when selected by a policy probability gate.

``output = Equalize(probability)(input)`` equalizes the histograms of selected images in a floating ``(B, C, H, W)``
batch and keeps its shape. Selected inputs and outputs are clamped to ``[0, 1]``.

Args:
    initial_probability: probability of applying the operation to each image.
    temperature: retained for API compatibility.

Note:
    Equalize cannot update probabilities yet.

See Also:
    - :class:`~kornia.augmentation.auto.operations.ops.AutoContrast`: stretches ranges without equalization.

c                ó*   <€ V ^8„  d   QhRS[ RS[ RR/# ©r   r`   ra   r   N©rc   )r   r<   s   "€r   r   ÚEqualize.__annotate__0  ó#   ø€ ÷ 
ñ 
©Eð 
Áeð 
ÐVZñ 
r   c                óZ   <€ \         SV `  \        P                  ! R VR7      RVR R7       R# rg   )rm   rn   ro   ÚRandomEqualize©rD   r`   ra   rq   s   &&&€r   rn   ÚEqualize.__init__0  s/   ø€ Ü‰ÑÜ×Ò¨5Ð4GÔHØ"Ø#Ø %ð	 	ö 	
r   r   ©rs   rt   ru   rx   s   @@r   r"   r"     s   ù‡ € ñ÷"
÷ 
õ 
r   c                   óF   a a€ ] tR tRt oRtRV3R lV 3R llltRtVtV ;t# )r#   i9  a  Convert selected images to grayscale while retaining their channel layout.

``output = Gray(probability)(input)`` replaces each selected floating image ``(B, C, H, W)`` with a channel average
broadcast back to all channels. RGB inputs use luminance weights; other nonempty channel counts use equal weights.
Values are not clamped; use :class:`Saturate` for a continuous blend toward grayscale.

Args:
    initial_probability: probability of applying the operation to each image.
    temperature: retained for API compatibility.

See Also:
    - :class:`~kornia.augmentation.auto.operations.ops.Saturate`: adjusts saturation continuously.

c                ó*   <€ V ^8„  d   QhRS[ RS[ RR/# rœ   r�   )r   r<   s   "€r   r   ÚGray.__annotate__I  rŸ   r   c                óZ   <€ \         SV `  \        P                  ! R VR7      RVR R7       R# rg   )rm   rn   ro   ÚRandomGrayscaler¢   s   &&&€r   rn   ÚGray.__init__I  s/   ø€ Ü‰ÑÜ×Ò¨EÐ5HÔIØ"Ø#Ø %ð	 	ö 	
r   r   r¤   ru   rx   s   @@r   r#   r#   9  s   ù‡ € ñ÷
÷ 
õ 
r   c                   óF   a a€ ] tR tRt oRtRV3R lV 3R llltRtVtV ;t# )r&   iR  aè  Invert selected image values around the operation's supported range.

``output = Invert(probability)(input)`` replaces selected values with ``1 - input`` in a floating ``(B, C, H, W)``
batch. It preserves the shape and does not clamp values.

Args:
    initial_probability: probability of applying the operation to each image.
    temperature: retained for API compatibility.

See Also:
    - :class:`~kornia.augmentation.auto.operations.ops.Solarize`: inverts values above a threshold.

c                ó*   <€ V ^8„  d   QhRS[ RS[ RR/# rœ   r�   )r   r<   s   "€r   r   ÚInvert.__annotate__a  rŸ   r   c                óZ   <€ \         SV `  \        P                  ! R VR7      RVR R7       R# rg   )rm   rn   ro   ÚRandomInvertr¢   s   &&&€r   rn   ÚInvert.__init__a  s-   ø€ Ü‰ÑÜ�NŠN¨Ð2EÔFØ"Ø#Ø %ð	 	ö 	
r   r   r¤   ru   rx   s   @@r   r&   r&   R  ó   ù‡ € ñ÷
÷ 
õ 
r   c                   ób   a a€ ] tR tRt oRt]V3R lR l4       tRV3R lV 3R llltRtVt	V ;t
# )	r'   ij  aó  Reduce selected images to a policy-controlled number of bits.

``output = Posterize(magnitude, probability)(input)`` reduces the retained bits of selected floating
``(B, C, H, W)`` images. Selected inputs are clamped to ``[0, 1]`` and the magnitude is truncated to an integer bit
count.

Args:
    initial_magnitude: the initial magnitude.
    initial_probability: probability of applying the operation to each image.
    magnitude_range: the sampling range for random sampling and clamping the optimized magnitude.
    temperature: retained for API compatibility.
    symmetric_megnitude: if to randomly assign the magnitude as negative or not.

See Also:
    - :class:`~kornia.augmentation.auto.operations.ops.Solarize`: applies thresholded inversion.

c                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# ©r   Ú	magnituder   ©r   r   )r   r<   s   "€r   r   ÚPosterize.__annotate__~  s#   ø€ ÷  ñ  ¡e§l¡lð  ±u·|±|ñ  r   c                ó"   € V P                  4       # r   )Úlong©rµ   s   &r   Ú_process_magnitudeÚPosterize._process_magnitude}  s   € à�~‰~ÓÐr   c                ób   <€ V ^8„  d   QhRS[ S[,          RS[RS[S[S[3,          RS[RS[RR/# r{   r}   )r   r<   s   "€r   r   r·   �  sT   ø€ ÷ 
ñ 
á#¡E�?ð
ñ #ð
ñ ™u¡e˜|Õ,ð	
ñ
 ð
ñ "ð
ð 
ñ
r   c                ó€   <€ \         SV `  \        P                  ! VR VR7      RV3.VV\        P
                  R7       R# )Frh   Úbits_factor©rl   ra   rb   Úmagnitude_fnN)rm   rn   ro   ÚRandomPosterizer'   r»   r�   s   &&&&&&€r   rn   ÚPosterize.__init__�  sE   ø€ ô 	‰ÑÜ×Ò˜o¸UÐFYÔZØ -Ð/@ÐAÐBØ#Ø 3Ü"×5Ñ5ð 	ö 	
r   r   )g      @rs   )ç      ð?g       @rt   F©rI   rJ   rK   rL   rv   Ústaticmethodr»   rn   rM   rN   rw   rx   s   @@r   r'   r'   j  s-   ù‡ € ñð$ ÷ ó ð ÷
÷ 
õ 
r   c                   óF   a a€ ] tR tRt oRtRV3R lV 3R llltRtVtV ;t# )r-   i’  aÈ  Invert values at or above a policy-controlled solarization threshold.

``output = Solarize(magnitude, probability)(input)`` inverts values at or above the magnitude's threshold in
selected floating ``(B, C, H, W)`` images after clamping inputs to ``[0, 1]``.

Args:
    initial_magnitude: the initial magnitude.
    initial_probability: probability of applying the operation to each image.
    magnitude_range: the range for sampling and clamping the magnitude.
    symmetric_megnitude: whether to assign a random sign to the magnitude.
    temperature: retained for API compatibility.

See Also:
    - :class:`~kornia.augmentation.auto.operations.ops.Invert`: inverts all values rather than a thresholded set.

c                ób   <€ V ^8„  d   QhRS[ S[,          RS[RS[S[S[3,          RS[RS[RR/# r{   r}   )r   r<   s   "€r   r   ÚSolarize.__annotate__¤  r   r   c           	     ód   <€ \         SV `  \        P                  ! VR RVR7      RV3.VVR7       R# )r“   F)Ú	additionsri   rj   Ú
thresholdsrk   N©rm   rn   ro   ÚRandomSolarizer�   s   &&&&&&€r   rn   ÚSolarize.__init__¤  s>   ø€ ô 	‰ÑÜ×Ò˜_¸È5ÐTgÔhØ ,Ð.?Ð@ÐAØ#Ø 3ð	 	ö 	
r   r   )rs   rs   )r“   rÄ   rt   Fru   rx   s   @@r   r-   r-   ’  r”   r   c                   óF   a a€ ] tR tRt oRtRV3R lV 3R llltRtVtV ;t# )r.   i´  aÿ  Add an intensity offset, then invert values above a random threshold.

``output = SolarizeAdd(magnitude, probability)(input)`` clamps selected floating images ``(B, C, H, W)`` into
``[0, 1]``, adds the magnitude to every pixel, clamps again, then inverts values at or above a sampled threshold.
The threshold is sampled from ``[0, 1]`` per selected image. This is a known defect tracked in
`#6561 <https://github.com/kornia/kornia/issues/6561>`_: reference solarize-add adds only below a fixed
``128 / 255`` threshold and never inverts pixels.

Args:
    initial_magnitude: the initial magnitude.
    initial_probability: probability of applying the operation to each image.
    magnitude_range: the sampling range for random sampling and clamping the optimized magnitude.
    temperature: retained for API compatibility.
    symmetric_megnitude: if to randomly assign the magnitude as negative or not.

See Also:
    - :class:`~kornia.augmentation.auto.operations.ops.Solarize`: controls the threshold without an offset.

c                ób   <€ V ^8„  d   QhRS[ S[,          RS[RS[S[S[3,          RS[RS[RR/# r{   r}   )r   r<   s   "€r   r   ÚSolarizeAdd.__annotate__É  r   r   c           	     ód   <€ \         SV `  \        P                  ! R VRVR7      RV3.VVR7       R# )rs   F)rÌ   rË   ri   rj   rË   rk   NrÍ   r�   s   &&&&&&€r   rn   ÚSolarizeAdd.__init__É  s?   ø€ ô 	‰ÑÜ×Ò¨°ÐV[Ð_rÔsØ +Ð->Ð?Ð@Ø#Ø 3ð	 	ö 	
r   r   )r“   rs   )g333333Ó¿ç333333Ó?rt   Fru   rx   s   @@r   r.   r.   ´  s   ù‡ € ñ÷(
÷ 
õ 
r   c                   óF   a a€ ] tR tRt oRtRV3R lV 3R llltRtVtV ;t# )r*   iÙ  a„  Blend selected images with a smoothed copy at a policy-controlled factor.

``output = Sharpness(magnitude, probability)(input)`` blends selected floating ``(B, C, H, W)`` images with a
smoothed copy. A factor of zero selects the smoothed image, one keeps the input, and larger factors sharpen;
selected inputs and outputs are clamped into ``[0, 1]``. Height and width must be at least three pixels when the
operation runs.

Args:
    initial_magnitude: the initial magnitude.
    initial_probability: probability of applying the operation to each image.
    magnitude_range: the sampling range for random sampling and clamping the optimized magnitude.
    temperature: retained for API compatibility.
    symmetric_megnitude: if to randomly assign the magnitude as negative or not.

See Also:
    - :class:`~kornia.augmentation.auto.operations.ops.Contrast`: changes contrast rather than sharpness.

c                ób   <€ V ^8„  d   QhRS[ S[,          RS[RS[S[S[3,          RS[RS[RR/# r{   r}   )r   r<   s   "€r   r   ÚSharpness.__annotate__í  r   r   c                ób   <€ \         SV `  \        P                  ! VR VR7      RV3.VVR7       R# )Frh   Ú	sharpnessrk   N)rm   rn   ro   ÚRandomSharpnessr�   s   &&&&&&€r   rn   ÚSharpness.__init__í  s<   ø€ ô 	‰ÑÜ×Ò˜o¸UÐFYÔZØ +Ð->Ð?Ð@Ø#Ø 3ð	 	ö 	
r   r   )rs   rs   )rt   gffffffþ?rt   Fru   rx   s   @@r   r*   r*   Ù  r‹   r   c                   óF   a a€ ] tR tRt oRtRV3R lV 3R llltRtVtV ;t# )r$   iý  a¶  Reverse image columns with a policy probability gate.

``output = HorizontalFlip(probability)(input)`` reverses columns of selected floating ``(B, C, H, W)`` images,
preserving shape and pixel values.

Args:
    initial_probability: probability of applying the operation to each image.
    temperature: retained for API compatibility.

See Also:
    - :class:`~kornia.augmentation.auto.operations.ops.VerticalFlip`: reverses image rows.

c                ó*   <€ V ^8„  d   QhRS[ RS[ RR/# rœ   r�   )r   r<   s   "€r   r   ÚHorizontalFlip.__annotate__  rŸ   r   c                óZ   <€ \         SV `  \        P                  ! R VR7      RVR R7       R# rg   )rm   rn   ro   ÚRandomHorizontalFlipr¢   s   &&&€r   rn   ÚHorizontalFlip.__init__  s/   ø€ Ü‰ÑÜ×"Ò"°Ð:MÔNØ"Ø#Ø %ð	 	ö 	
r   r   r¤   ru   rx   s   @@r   r$   r$   ý  r±   r   c                   óF   a a€ ] tR tRt oRtRV3R lV 3R llltRtVtV ;t# )r1   i  a³  Reverse image rows with a policy probability gate.

``output = VerticalFlip(probability)(input)`` reverses rows of selected floating ``(B, C, H, W)`` images, preserving
shape and pixel values.

Args:
    initial_probability: probability of applying the operation to each image.
    temperature: retained for API compatibility.

See Also:
    - :class:`~kornia.augmentation.auto.operations.ops.HorizontalFlip`: reverses image columns.

c                ó*   <€ V ^8„  d   QhRS[ RS[ RR/# rœ   r�   )r   r<   s   "€r   r   ÚVerticalFlip.__annotate__$  rŸ   r   c                óZ   <€ \         SV `  \        P                  ! R VR7      RVR R7       R# rg   )rm   rn   ro   ÚRandomVerticalFlipr¢   s   &&&€r   rn   ÚVerticalFlip.__init__$  s/   ø€ Ü‰ÑÜ× Ò ¨uÐ8KÔLØ"Ø#Ø %ð	 	ö 	
r   r   r¤   ru   rx   s   @@r   r1   r1     r±   r   c                   óF   a a€ ] tR tRt oRtRV3R lV 3R llltRtVtV ;t# )r(   i-  a)  Rotate selected images by a policy-controlled angle.

``output = Rotate(magnitude, probability)(input)`` rotates selected floating ``(B, C, H, W)`` images about their
centers, keeping the output size. The magnitude is in degrees with a random sign by default.

Args:
    initial_magnitude: the initial magnitude.
    initial_probability: probability of applying the operation to each image.
    magnitude_range: the sampling range for random sampling and clamping the optimized magnitude.
    temperature: retained for API compatibility.
    symmetric_megnitude: if to randomly assign the magnitude as negative or not.

See Also:
    - :class:`~kornia.augmentation.auto.operations.ops.ShearX`: shears along the x axis.
    - :class:`~kornia.augmentation.auto.operations.ops.ShearY`: shears along the y axis.

c                ób   <€ V ^8„  d   QhRS[ S[,          RS[RS[S[S[3,          RS[RS[RR/# r{   r}   )r   r<   s   "€r   r   ÚRotate.__annotate__@  óT   ø€ ÷ 
ñ 
á#¡E�?ð
ñ #ð
ñ ™u¡e˜|Õ,ð	
ñ
 ð
ñ "ð
ð 
ñ
r   c                óè   <€ V'       d<   V^ ,          ^ 8  d.   \        RV P                  P                   RV^ ,           R24      h\        SV `  \
        P                  ! VRVR7      RV3.VVR7       R# )	é    úLower bound of ú= is a symmetric operation. The lower bound must above 0. Got Ú.Frh   Údegreesrk   N)Ú
ValueErrorrq   rI   rm   rn   ro   ÚRandomRotationr�   s   &&&&&&€r   rn   ÚRotate.__init__@  s„   ø€ ÷  ?°1Õ#5¸Ô#9ÜØ! $§.¡.×"9Ñ"9Ð!:ð ;5Ø5DÀQÕ5GÐ4HÈðKóð ô 	‰ÑÜ×Ò˜_¸EÐEXÔYØ )Ð+<Ð=Ð>Ø#Ø 3ð	 	ö 	
r   r   )g      .@rs   )r“   g      >@rt   Tru   rx   s   @@r   r(   r(   -  s   ù‡ € ñ÷$
÷ 
õ 
r   c                   ób   a a€ ] tR tRt oRt]V3R lR l4       tRV3R lV 3R llltRtVt	V ;t
# )	r+   iU  a  Shear selected images along the x axis by a policy-controlled amount.

``output = ShearX(magnitude, probability)(input)`` shears selected floating ``(B, C, H, W)`` images along x, keeping
the output size. The magnitude is a shear factor with a random sign by default.

The magnitude is the shear factor, as in PIL and torchvision, whether it is sampled from ``magnitude_range``,
learned, or passed to ``forward_parameters``. It is mapped to the wrapped augmentation's degrees with
``rad2deg(atan(magnitude))``, so a magnitude of ``0.3`` shears by about ``16.7`` degrees.

Args:
    initial_magnitude: the initial magnitude, a shear factor.
    initial_probability: probability of applying the operation to each image.
    magnitude_range: the sampling range for random sampling and clamping the optimized magnitude.
    temperature: retained for API compatibility.
    symmetric_megnitude: if to randomly assign the magnitude as negative or not.

See Also:
    - :class:`~kornia.augmentation.auto.operations.ops.ShearY`: shears along the y axis.

c                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# r´   r¶   )r   r<   s   "€r   r   ÚShearX.__annotate__l  ó#   ø€ ÷ 9ñ 9¡e§l¡lð 9±u·|±|ñ 9r   c                ó<   € \         P                  ! V 4      R ,          # ©gøÁcÜ¥L@©r   Úatanrº   s   &r   r»   ÚShearX._process_magnitudek  ó   € ô �zŠz˜)Ó$Ð'8Õ8Ð8r   c                ób   <€ V ^8„  d   QhRS[ S[,          RS[RS[S[S[3,          RS[RS[RR/# r{   r}   )r   r<   s   "€r   r   rø   q  sT   ø€ ÷ 
ñ 
á#¡E�?ð
ñ #ð
ñ ™u¡e˜|Õ,ð	
ñ
 ð
ñ "ð
ð 
ñ
r   c           	     ó  <€ V'       d<   V^ ,          ^ 8  d.   \        RV P                  P                   RV^ ,           R24      h\        SV `  \
        P                  ! VRVRR7      RV3.VV\        P                  R7       R	# )
rî   rï   rð   rñ   FT©ri   rj   Úalign_cornersÚshear_xrÀ   N)	ró   rq   rI   rm   rn   ro   ÚRandomShearr+   r»   r�   s   &&&&&&€r   rn   ÚShearX.__init__q  sŽ   ø€ ÷  ?°1Õ#5¸Ô#9ÜØ! $§.¡.×"9Ñ"9Ð!:ð ;5Ø5DÀQÕ5GÐ4HÈðKóð ô 	‰ÑÜ�MŠM˜/¸ÐBUÐeiÔjØ )Ð+<Ð=Ð>Ø#Ø 3Ü×2Ñ2ð 	ö 	
r   r   ©rt   rs   )r“   rÕ   rt   TrÅ   rx   s   @@r   r+   r+   U  s-   ù‡ € ñð* ÷9ó ð9÷

÷ 
õ 
r   c                   ób   a a€ ] tR tRt oRt]V3R lR l4       tRV3R lV 3R llltRtVt	V ;t
# )	r,   i‡  a  Shear selected images along the y axis by a policy-controlled amount.

``output = ShearY(magnitude, probability)(input)`` shears selected floating ``(B, C, H, W)`` images along y, keeping
the output size. The magnitude is a shear factor with a random sign by default.

The magnitude is the shear factor, as in PIL and torchvision, whether it is sampled from ``magnitude_range``,
learned, or passed to ``forward_parameters``. It is mapped to the wrapped augmentation's degrees with
``rad2deg(atan(magnitude))``, so a magnitude of ``0.3`` shears by about ``16.7`` degrees.

Args:
    initial_magnitude: the initial magnitude, a shear factor.
    initial_probability: probability of applying the operation to each image.
    magnitude_range: the sampling range for random sampling and clamping the optimized magnitude.
    temperature: retained for API compatibility.
    symmetric_megnitude: if to randomly assign the magnitude as negative or not.

See Also:
    - :class:`~kornia.augmentation.auto.operations.ops.ShearX`: shears along the x axis.

c                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# r´   r¶   )r   r<   s   "€r   r   ÚShearY.__annotate__ž  rù   r   c                ó<   € \         P                  ! V 4      R ,          # rû   rü   rº   s   &r   r»   ÚShearY._process_magnitude�  rÿ   r   c                ób   <€ V ^8„  d   QhRS[ S[,          RS[RS[S[S[3,          RS[RS[RR/# r{   r}   )r   r<   s   "€r   r   r
  £  sT   ø€ ÷ 
ñ 
á#¡E�?ð
ñ #ð
ñ ™u¡e˜|Õ,ð	
ñ
 ð
ñ "ð
ð 
ñ
r   c           	     ó,  <€ V'       d<   V^ ,          ^ 8  d.   \        RV P                  P                   RV^ ,           R24      h\        SV `  \
        P                  ! RRV^ ,          V^,          3RVRR7      RV3.VV\        P                  R	7       R
# )rî   rï   rð   rñ   r“   FTr  Úshear_yrÀ   N)	ró   rq   rI   rm   rn   ro   r  r,   r»   r�   s   &&&&&&€r   rn   ÚShearY.__init__£  s§   ø€ ÷  ?°1Õ#5¸Ô#9ÜØ! $§.¡.×"9Ñ"9Ð!:ð ;5Ø5DÀQÕ5GÐ4HÈðKóð ô 	‰ÑÜ�MŠMØ�c˜?¨1Õ-¨¸qÕ/AÐBØ#Ø%Ø"ô	ð !*Ð+<Ð=Ð>Ø#Ø 3Ü×2Ñ2ð 	ö 	
r   r   r  rÅ   rx   s   @@r   r,   r,   ‡  s-   ù‡ € ñð* ÷9ó ð9÷

÷ 
õ 
r   c                   ób   a a€ ] tR tRt oRtRV3R lV 3R llltR	V3R lV 3R llltRtVtV ;t	# )
r/   i¾  aó  Translate selected images along the x axis by a policy-controlled amount.

``output = TranslateX(magnitude, probability)(input)`` shifts selected floating ``(B, C, H, W)`` images
horizontally, keeping the output size. The magnitude is a fraction of image width with a random sign by default.

The magnitude is a fraction of the image width, whether it is sampled from ``magnitude_range``, learned, or passed
to ``forward_parameters``; the wrapped augmentation translates by that fraction of the width in pixels.

Args:
    initial_magnitude: the initial magnitude, a fraction of the image width.
    initial_probability: probability of applying the operation to each image.
    magnitude_range: the sampling range for random sampling and clamping the optimized magnitude.
    temperature: retained for API compatibility.
    symmetric_megnitude: if to randomly assign the magnitude as negative or not.

See Also:
    - :class:`~kornia.augmentation.auto.operations.ops.TranslateY`: translates along the y axis.

c                ób   <€ V ^8„  d   QhRS[ S[,          RS[RS[S[S[3,          RS[RS[RR/# r{   r}   )r   r<   s   "€r   r   ÚTranslateX.__annotate__Ó  rì   r   c           	     óê   <€ V'       d<   V^ ,          ^ 8  d.   \        RV P                  P                   RV^ ,           R24      h\        SV `  \
        P                  ! VRVRR7      RV3.VVR7       R	# )
rî   rï   rð   rñ   FTr  Útranslate_xrk   N©ró   rq   rI   rm   rn   ro   ÚRandomTranslater�   s   &&&&&&€r   rn   ÚTranslateX.__init__Ó  s‡   ø€ ÷  ?°1Õ#5¸Ô#9ÜØ! $§.¡.×"9Ñ"9Ð!:ð ;5Ø5DÀQÕ5GÐ4HÈðKóð ô 	‰ÑÜ×Ò˜o¸UÐFYÐimÔnØ -Ð/@ÐAÐBØ#Ø 3ð	 	ö 	
r   c                óŽ   <€ V ^8„  d   QhRS[ P                  RS[S[ P                  ,          RS[S[S[ P                  3,          /# ©r   Úbatch_shaper   r   ©r   ÚSizer   r   r   r;   )r   r<   s   "€r   r   r  ç  ó@   ø€ ÷ <ñ <Ù Ÿ:™:ð<Ù,4±U·\±\Õ,Bð<á	‰c‘5—<‘<ÐÕ	 ñ<r   c                óh   <€ \        Vf   V P                  MTVR,          4      p\        SV `  W4      # )a  Sample parameters, converting a set magnitude from a fraction of the width to pixels.

Args:
    batch_shape: Input batch shape used for sampling.
    mag: Optional magnitude override, a fraction of the image width.

Returns:
    Parameter dictionary consumed by :meth:`forward`.
éÿÿÿÿ©r   rµ   rm   Úforward_parameters©rD   r  r   rq   s   &&&€r   r"  ÚTranslateX.forward_parametersç  ó0   ø€ ô "°C²K $§.¢.ÀSÈ+ÐVXÍ/ÓZˆÜ‰wÑ)¨+Ó;Ð;r   r   ©r…   rs   )r“   rs   rt   Tr   ©
rI   rJ   rK   rL   rv   rn   r"  rM   rN   rw   rx   s   @@r   r/   r/   ¾  ó#   ù‡ € ñ÷(
õ 
÷(<÷ <õ <r   c                   ób   a a€ ] tR tRt oRtRV3R lV 3R llltR	V3R lV 3R llltRtVtV ;t	# )
r0   i÷  aõ  Translate selected images along the y axis by a policy-controlled amount.

``output = TranslateY(magnitude, probability)(input)`` shifts selected floating ``(B, C, H, W)`` images vertically,
keeping the output size. The magnitude is a fraction of image height with a random sign by default.

The magnitude is a fraction of the image height, whether it is sampled from ``magnitude_range``, learned, or
passed to ``forward_parameters``; the wrapped augmentation translates by that fraction of the height in pixels.

Args:
    initial_magnitude: the initial magnitude, a fraction of the image height.
    initial_probability: probability of applying the operation to each image.
    magnitude_range: the sampling range for random sampling and clamping the optimized magnitude.
    temperature: retained for API compatibility.
    symmetric_megnitude: if to randomly assign the magnitude as negative or not.

See Also:
    - :class:`~kornia.augmentation.auto.operations.ops.TranslateX`: translates along the x axis.

c                ób   <€ V ^8„  d   QhRS[ S[,          RS[RS[S[S[3,          RS[RS[RR/# r{   r}   )r   r<   s   "€r   r   ÚTranslateY.__annotate__  rì   r   c           
     óì   <€ V'       d<   V^ ,          ^ 8  d.   \        RV P                  P                   RV^ ,           R24      h\        SV `  \
        P                  ! RVRVRR7      RV3.VVR	7       R# )
rî   rï   rð   rñ   NFTr  Útranslate_yrk   r  r�   s   &&&&&&€r   rn   ÚTranslateY.__init__  s‰   ø€ ÷  ?°1Õ#5¸Ô#9ÜØ! $§.¡.×"9Ñ"9Ð!:ð ;5Ø5DÀQÕ5GÐ4HÈðKóð ô 	‰ÑÜ×Ò˜d OÀ5ÐL_ÐosÔtØ -Ð/@ÐAÐBØ#Ø 3ð	 	ö 	
r   c                óŽ   <€ V ^8„  d   QhRS[ P                  RS[S[ P                  ,          RS[S[S[ P                  3,          /# r  r  )r   r<   s   "€r   r   r+     r  r   c                óh   <€ \        Vf   V P                  MTVR,          4      p\        SV `  W4      # )a  Sample parameters, converting a set magnitude from a fraction of the height to pixels.

Args:
    batch_shape: Input batch shape used for sampling.
    mag: Optional magnitude override, a fraction of the image height.

Returns:
    Parameter dictionary consumed by :meth:`forward`.
éþÿÿÿr!  r#  s   &&&€r   r"  ÚTranslateY.forward_parameters   r%  r   r   r&  r   r'  rx   s   @@r   r0   r0   ÷  r(  r   )r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   )1rv   Útypingr   r   r   r   r   Úkornia.augmentationÚaugmentationro   Ú,kornia.augmentation._2d.intensity.brightnessr   Ú*kornia.augmentation._2d.intensity.contrastr   Ú,kornia.augmentation._2d.intensity.saturationr   Ú(kornia.augmentation.auto.operations.baser	   Úkornia.core.utilsr
   r   Úkornia.enhancer   r   r   r   Ú__all__r3   rQ   rX   r   r    r!   r%   r)   r"   r#   r&   r'   r-   r.   r*   r$   r1   r(   r+   r,   r/   r0   r   r   r   Ú<module>r=     sY  ðñ"
÷ .Ó -ã å Ý IÝ EÝ IÝ Bß G÷ñ õ/ò€ô.
PÐ%ô 
Pô
W�>ô 
Wô
YÐ%ô 
Yô
�=ô 
ô8 
�ô  
ôF!
ˆ}ô !
ôH
ˆ-ô 
ôD#
ˆ}ô #
ôN
ˆ}ô 
ô6
ˆ=ô 
ô2
ˆ]ô 
ô0%
�ô %
ôP
ˆ}ô 
ôD"
�-ô "
ôJ!
�ô !
ôH
�]ô 
ô0
�=ô 
ô0%
ˆ]ô %
ôP/
ˆ]ô /
ôd4
ˆ]ô 4
ôn6<�ô 6<ôr6<�ö 6<r   