+
    ÷äûjQ   ã                   ó|   € ^ RI HtHtHtHt ^ RIHt ^ RIHtH	t	 ^ RI
Ht ^ RIHt  ! R R4      t ! R R	]4      tR
# )é    )ÚAnyÚDictÚOptionalÚSequence)ÚTensor)ÚRigidAffineAugmentationBase2DÚ_input_metadata_only)ÚBoxes)Ú	Keypointsc                   ól   a a€ ] tR t^t oRtV3R lR ltV3R lV 3R lltV3R lV 3R lltRtVt	V ;t
# )	Ú_PicklableCompileMixina5  Keep a module picklable after its own ``compile()`` replaced callables with ``torch.compile``d ones.

``compile()`` calls :meth:`_record_compile` before compiling. Pickling (and ``copy.deepcopy``) then stores
the uncompiled callables, which pickle, and unpickling compiles them again with the same arguments.
c                óP   <€ V ^8„  d   QhRS[ S[,          RS[S[S[3,          RR/# )é   ÚnamesÚcompile_kwargsÚreturnN)r   Ústrr   r   )ÚformatÚ__classdict__s   "€ÚbC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\kornia\augmentation\_2d\intensity\base.pyÚ__annotate__Ú#_PicklableCompileMixin.__annotate__"   s/   ø€ ÷ .ñ .¡X©c¥]ð .ÁDÉÉcÈÅNð .ÐW[ñ .ó    c                ó–   € V P                   P                  R 4      f!   V Uu/ uF  q3\        W4      bK  	  upV n        W n        R# u upi )Ú_uncompiled_fnsN)Ú__dict__ÚgetÚgetattrr   Ú_compile_kwargs)Úselfr   r   Únames   &&& r   Ú_record_compileÚ&_PicklableCompileMixin._record_compile"   sC   € à�=‰=×ÑÐ.Ó/Ò7ÙJOÓ#PÉ%À$¬'°$Ó*=Ò$=É%Ñ#PˆDÔ Ø-Öùò $Qs   ¢Ac                ó6   <€ V ^8„  d   QhRS[ S[S[3,          /# )r   r   ©r   r   r   )r   r   s   "€r   r   r   (   s   ø€ ÷ ñ ™d¡3© 8�nñ r   c                óp   <€ \         SV `  4       pVP                  R 4      pVe   VP                  V4       V# )r   )ÚsuperÚ__getstate__r   Úupdate)r    ÚstateÚ
uncompiledÚ	__class__s   &  €r   r(   Ú#_PicklableCompileMixin.__getstate__(   s6   ø€ Ü‘Ñ$Ó&ˆØ—Y‘YÐ0Ó1ˆ
ØÒ!Ø�L‰L˜Ô$Øˆr   c                ó:   <€ V ^8„  d   QhRS[ S[S[3,          RR/# )r   r*   r   Nr%   )r   r   s   "€r   r   r   /   s#   ø€ ÷ +ñ +¡$¡s©C x¥.ð +°Tñ +r   c                ó†   <€ \         SV `  V4       VP                  R 4      pVe   RV n        V P                  ! R/ VB  R# R# )r   N© )r'   Ú__setstate__r   r   Úcompile)r    r*   r   r,   s   && €r   r1   Ú#_PicklableCompileMixin.__setstate__/   sA   ø€ Ü‰Ñ˜UÔ#ØŸ™Ð#4Ó5ˆØÒ%Ø#'ˆDÔ Ø�LŠLÑ*˜>Ô*ñ &r   )r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r"   r(   r1   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r,   r   s   @@r   r   r      s-   ù‡ € ñ÷.ð .÷ó ÷+÷ +ó +r   r   c                   óÈ   a € ] tR t^7t o RtRt]V 3R lR l4       tRV 3R lR lltRV 3R lR	 llt	RV 3R
 lR llt
RV 3R lR lltRV 3R lR lltRV 3R lR lltRtV tR# )ÚIntensityAugmentationBase2Du¼  Build a 2D value augmentation, per sample with probability ``p`` (default 0.5).

``output = MyAugmentation(...)(input)`` changes pixel values once a subclass implements ``apply_transform``.
The base supplies the probability gate, parameter replay and identity geometric transform. Use
:class:`~kornia.augmentation.GeometricAugmentationBase2D` for an augmentation that moves pixels.

See the Convention block on :class:`~kornia.augmentation.AugmentationBase2D`.

Args:
    p: probability for applying an augmentation. This param controls the augmentation probabilities
      element-wise for a batch.
    p_batch: probability for applying an augmentation to a batch. This param controls the augmentation
      probabilities batch-wise.
    same_on_batch: apply the same transformation across the batch.
    keepdim: whether to keep the output shape the same as input ``True`` or broadcast it
      to the batch form ``False``.

Convention:
    - an intensity augmentation moves no image pixel, so this base supplies ``compute_transformation``
      itself and reports the identity matrix, built lazily on the first read of ``transform_matrix``. Its
      mask, box and keypoint handlers pass their inputs through unless a subclass overrides them
      (:class:`RandomErasing` also erases masks). It adds no ``inverse``:
      :class:`~kornia.augmentation.container.AugmentationSequential.inverse` skips 2D intensity children.
    - classes whose arithmetic assumes unit-range images clamp the input into ``[0, 1]`` before
      the operation, and clamp the result too. That input clamp passes the gradient of a value in
      ``[0, 1]``, ``0`` and ``1`` included, unchanged, and gives a value outside a zero gradient, on every
      supported torch version. Range-independent classes do not clamp their input;
      their class pages state this explicitly. ``RandomBrightness`` and ``RandomContrast`` opt out of
      both clamps with ``clip_output=False``. Normalize after range-dependent augmentations: clamping
      an all-negative normalized image discards its information and may produce an all-zero output.
    - what this block and the class pages say about an output describes the samples the ``p`` gate
      transforms; every other sample comes back with its input values and, where they are finite, an
      identity gradient. Below ``p=1`` :class:`RandomEqualize`, :class:`RandomClahe` and :class:`RandomGamma`
      run their transform on 0.5 for the skipped samples, so those discarded computations do not
      affect the skipped image or its gradient.
    - the scalar factors a concrete class draws are per sample -- one value, or one per channel
      per sample where the class's own docstring says so -- and ``same_on_batch=True`` shares one draw.
      :class:`RandomMotionBlur` draws one kernel size for the whole batch; :class:`Normalize`,
      :class:`Denormalize` and :class:`RandomDissolving` hard-code ``same_on_batch=True``. A drawn
      whole-image field (``gaussian_noise``, ``gradient``, ``plasma``, and :class:`RandomSaltAndPepperNoise`'s
      ``mask_salt`` and ``mask_pepper``) is stored with the batched ``(B, C, H, W)`` input shape, even for a
      ``(C, H, W)`` input with ``keepdim=True``; :class:`RandomPlasmaShadow`'s single-channel map is
      ``(B, 1, H, W)``. With ``same_on_batch=True``, ``gaussian_noise`` is stored as
      ``(1, C, H, W)`` and the plasma classes store an expanded view that shares one map across the batch.
    - where a class documents bounds for a parameter, a range outside them usually raises at construction;
      the class page states a bound it does not enforce, or checks only on the forward pass. A scalar
      magnitude ``x`` usually means ``center Â± x`` around a center the class fixes -- the neutral value, for a
      factor such as ``contrast`` -- with its lower end floored at the bound, so ``contrast=1.5`` reads as
      ``[0, 2.5]``, while an upper end past the bound raises. :class:`RandomSharpness` reads a scalar as
      ``[0, x]`` and :class:`RandomPosterize` as ``[x, 8]``.

See Also:
    - :class:`~kornia.augmentation.GeometricAugmentationBase2D`: base class for transforms that move pixels.
    - :class:`~kornia.augmentation.AugmentationBase2D`: common base for all 2D augmentations.

Tc                ó^   <€ V ^8„  d   QhRS[ RS[S[S[ 3,          RS[S[S[3,          RS[ /# )r   ÚinputÚparamsÚflagsr   )r   r   r   r   )r   r   s   "€r   r   Ú(IntensityAugmentationBase2D.__annotate__w   s@   ø€ ÷ +ñ +©Fð +¹DÁÁfÀÕ<Mð +ÑVZÑ[^Ñ`cÐ[cÕVdð +Ñioñ +r   c                ó$   € V P                  V4      # ©N)Úidentity_matrix)r    r?   r@   rA   s   &&&&r   Úcompute_transformationÚ2IntensityAugmentationBase2D.compute_transformationv   s   € à×#Ñ# EÓ*Ð*r   Nc          
      ót   <€ V ^8„  d   QhRS[ RS[S[S[ 3,          RS[S[S[3,          RS[S[ ,          RS[ /# ©r   r?   r@   rA   Ú	transformr   ©r   r   r   r   r   )r   r   s   "€r   r   rB   z   óL   ø€ ÷ ñ ÙðÙ%)©#©v¨+Õ%6ðÙ?CÁCÉÀH½~ðÙZbÑciÕZjðá	ñr   c                ó   € V# rD   r0   ©r    r?   r@   rA   rJ   s   &&&&&r   Úapply_non_transform_maskÚ4IntensityAugmentationBase2D.apply_non_transform_maskz   ó	   € ð ˆr   c          
      ót   <€ V ^8„  d   QhRS[ RS[S[S[ 3,          RS[S[S[3,          RS[S[ ,          RS[ /# rI   rK   )r   r   s   "€r   r   rB      rL   r   c                ó   € V# rD   r0   rN   s   &&&&&r   Úapply_transform_maskÚ0IntensityAugmentationBase2D.apply_transform_mask   rQ   r   c          
      ót   <€ V ^8„  d   QhRS[ RS[S[S[3,          RS[S[S[3,          RS[S[,          RS[ /# rI   ©r
   r   r   r   r   r   )r   r   s   "€r   r   rB   „   óL   ø€ ÷ ñ ÙðÙ$(©©f¨Õ$5ðÙ>BÁ3ÉÀ8½nðÙYaÑbhÕYiðá	ñr   c                ó   € V# rD   r0   rN   s   &&&&&r   Úapply_non_transform_boxÚ3IntensityAugmentationBase2D.apply_non_transform_box„   rQ   r   c          
      ót   <€ V ^8„  d   QhRS[ RS[S[S[3,          RS[S[S[3,          RS[S[,          RS[ /# rI   rW   )r   r   s   "€r   r   rB   ‰   rX   r   c                ó   € V# rD   r0   rN   s   &&&&&r   Úapply_transform_boxÚ/IntensityAugmentationBase2D.apply_transform_box‰   rQ   r   c          
      ót   <€ V ^8„  d   QhRS[ RS[S[S[3,          RS[S[S[3,          RS[S[,          RS[ /# rI   )r   r   r   r   r   r   )r   r   s   "€r   r   rB   Ž   sL   ø€ ÷ ñ ÙðÙ(,©S±&¨[Õ(9ðÙBFÁsÉCÀxÅ.ðÙ]eÑflÕ]mðá	ñr   c                ó   € V# rD   r0   rN   s   &&&&&r   Úapply_transform_keypointÚ4IntensityAugmentationBase2D.apply_transform_keypointŽ   rQ   r   c          
      ót   <€ V ^8„  d   QhRS[ RS[S[S[ 3,          RS[S[S[3,          RS[S[ ,          RS[ /# rI   rK   )r   r   s   "€r   r   rB   “   rL   r   c                ó   € V# rD   r0   rN   s   &&&&&r   Úapply_transform_classÚ1IntensityAugmentationBase2D.apply_transform_class“   rQ   r   r0   rD   )r4   r5   r6   r7   r8   Ú_compute_matrix_lazilyr	   rF   rO   rT   rZ   r^   rb   rf   r9   r:   )r   s   @r   r=   r=   7   sf   ø‡ € ñ7ðx "Ðà÷+ó ð+÷ò ÷
ò ÷
ò ÷
ò ÷
ò ÷
÷ ð r   r=   N)Útypingr   r   r   r   Útorchr   Úkornia.augmentation._2d.baser   r	   Úkornia.geometry.boxesr
   Úkornia.geometry.keypointsr   r   r=   r0   r   r   Ú<module>rn      s2   ð÷$ 1Ó 0å ç \Ý 'Ý /÷+ñ +ô8_Ð"?ö _r   