+
    öäûj/e  ã                  óô   € ^ RI Ht ^ RIHtHtHt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Ht ^ RIHt ^ R	IHtHtHt ^ R
IHt ^ RIHt ^ RIH t H!t! ^ RI"H#t# ^ RI$H%t% R R lt& ! R R]4      t'R# )é    )Úannotations)ÚAnyÚDictÚListÚOptionalÚSequenceÚTupleÚUnionN)Úrandom_generator)ÚGeometricAugmentationBase2D)Ú_mixed_gate_shape_error)Ú_constant_tensorÚ_pad_with_fill)ÚResample)Ú_to_device_nonblockingÚis_compilingÚis_exporting)ÚBoxes)Ú	Keypoints)Úcrop_by_indicesÚcrop_by_transform_mat)Ú_compiled_slice_resize)Ú_crop_translationc          
     ó,   € V ^8„  d   QhRRRRRRRRR	R/# )
é   Úinputútorch.TensorÚpaddingú	List[int]Úfillz+Union[float, Sequence[float], torch.Tensor]Úpadding_modeÚstrÚreturn© )Úformats   "ÚbC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\kornia\augmentation\_2d\geometric\crop.pyÚ__annotate__r'   %   s4   € ÷ ñ ØðØ"+ðØ3^ðØnqðàñó    c                óÆ  € R V 4       w  rErgV RW`P                   R,          V,
          1W@P                   R,          V,
          13,          pV U	u. uF  p	\        V	) ^ 4      NK  	  p
p	\        V
4      '       de   \        V\        \
        34      '       g=   \        P                  ! V4      P                  4       VP                   ^,          8w  d   Rp\        WŠW#4      pV# u up	i )a‚  Undo ``precrop_padding`` with its ``[left, right, top, bottom]`` padding.

A border the forward call added is sliced off, which needs no fill: an image's per-channel ``fill`` does not
fit a one-channel mask. A negative entry cropped the input, and that border is padded back as the forward call
pads; a per-channel ``fill`` that does not match the channels (a mask) pads it with zeros.
c              3  ó:   "  € T F  p\        V^ 4      x € K  	  R# 5i)r   N)Úmax)Ú.0Úsides   & r&   Ú	<genexpr>Ú"_remove_padding.<locals>.<genexpr>.   s   é € ÐA¹°¤ D¨!§ »ùs   ‚.g        éþÿÿÿéÿÿÿÿ)
Úshaper+   ÚanyÚ
isinstanceÚintÚfloatÚtorchÚ	as_tensorÚnumelr   )r   r   r    r!   ÚleftÚrightÚtopÚbottomÚoutputr-   Úregrows   &&&&       r&   Ú_remove_paddingr@   %   s½   € ñ  B¹ÓAÑ€D�Ø�3˜Ÿk™k¨"�o°Õ6Ð6¸¿{¹{È2½ÐQVÕ?VÐ8VÐVÕW€FÙ(/Ó0© Œc�4�%˜Žm©€FÐ0Ü
ˆ6‡{‚{Ü˜$¤¤e ×-Ò-´%·/²/À$Ó2G×2MÑ2MÓ2OÐSY×S_ÑS_Ð`aÕSbÔ2bØˆDÜ °ÓCˆØ€Mùò 1s   ÁCc            
      ó*  a € ] tR t^8tRtRR^ R]P                  P                  RRRRR3
R V 3R	 llltR!R
 R llt	R"R R llt
R R ltR R ltR R ltR!R V 3R llltR!R V 3R llltR!R R lltR"R R lltR!R V 3R llltR V 3R lltR tV ;t# )#Ú
RandomCropañ  Crop random image patches to a requested size, applied to a batch with probability ``p`` (default 1.0).

``output = RandomCrop(size, ...)(input)`` chooses crop positions in images of shape ``(B, C, H, W)`` and returns
patches of ``size``. Use :class:`RandomResizedCrop` to resize the sampled patch.

Args:
    size: Desired output size (out_h, out_w) of the crop.
        Must be Tuple[int, int], then out_h = size[0], out_w = size[1].
    padding: Optional padding on each border
        of the image. Default is None, i.e no padding. If a sequence of length
        4 is provided, it is used to F.pad left, top, right, bottom borders
        respectively. If a sequence of length 2 is provided, it is used to
        F.pad left/right, top/bottom borders, respectively.
    pad_if_needed: It will F.pad the image if smaller than the
        desired size to avoid raising an exception. Since cropping is done
        after padding, the padding seems to be done at a random offset.
    fill: Pixel fill value for constant fill. Default is 0. A sequence gives one value per channel,
        so it must be as long as the input's channel dimension. This value is only used when the
        padding_mode is constant, and a sequence requires it.
    padding_mode: Type of padding. Should be: constant, reflect, replicate.
    resample: the interpolation mode.
    same_on_batch: apply the same transformation across the batch.
    align_corners: interpolation flag.
    p: probability of applying the transformation for the whole batch.
    keepdim: whether to keep the output shape the same as input (True) or broadcast it
             to the batch form (False).
    cropping_mode: The used algorithm to crop. ``slice`` will use advanced slicing to extract the torch.Tensor based
                   on the sampled indices. ``resample`` will use `warp_affine` using the affine transformation
                   to extract and resize at once. Use `slice` for efficiency, or `resample` for proper
                   differentiability.

Shape:
    - Input: ``(C, H, W)`` or ``(B, C, H, W)``, Optional: ``(B, 3, 3)``
    - Output: ``(B, C, out_h, out_w)``

Note:
    Input torch.Tensor must be float and normalized into [0, 1] for the best differentiability support.
    Additionally, this function accepts another transformation torch.Tensor (``(B, 3, 3)``), then the
    applied transformation will be merged int to the input transformation torch.Tensor and returned.

Convention:
    See :class:`~kornia.augmentation.GeometricAugmentationBase2D` for coordinates, defaults and inverse.
    ``size`` is an ``(height, width)`` tuple; a bare integer raises, unlike :class:`CenterCrop`
    (`#4417 <https://github.com/kornia/kornia/issues/4417>`_). ``p`` selects or skips the whole batch
    together; a skipped batch is returned unchanged and unpadded. ``transform_matrix`` maps original input
    coordinates to the crop, including the translation from ``padding`` or ``pad_if_needed``.

    Explicit ``padding`` is applied before sampling, in ``(left, top, right, bottom)`` order after its scalar
    or two-value shorthand is expanded. ``pad_if_needed=True`` pads each side by the maximum of that padding
    and the crop-minus-input size on its axis, so asymmetric explicit padding can stay asymmetric. In
    :class:`~kornia.augmentation.container.AugmentationSequential`, a per-channel ``fill`` pads only the image
    and the mask is padded with zero unless ``extra_args[DataKey.MASK]`` sets its ``fill``; a scalar ``fill``
    applies to both.

    With ``pad_if_needed=False``, a ``size`` larger than the canvas after explicit ``padding`` raises
    ``ValueError`` on either axis, whether or not the batch is selected; it used to return an upscale of the
    input. A crop that fits once padded is unaffected. Replayed ``params`` whose ``src`` box exceeds the canvas
    are not checked: slice mode resizes the available slice and scales only the matrix axes along which the box
    exceeds the canvas, on the resize's half-pixel grid, ``x' = (x + 0.5) * W_out / W_in - 0.5`` along a
    stretched axis (likewise for ``y``), and resample mode uses a warp that rescales both matrix axes and can
    blend in zero padding.

    Slice mode uses :func:`~kornia.geometry.transform.crop_by_indices` with its own defaults and ignores this
    class's ``resample`` and ``align_corners``. Resample mode uses the configured interpolation and
    ``align_corners`` and maps constant, replicate and reflect pre-padding to zero, border and reflection
    sampler padding. Both modes support ``inverse()``, for images, masks, boxes and keypoints: it warps with
    the inverse of the mode's ``transform_matrix``, removes the pre-crop padding, and cannot restore cropped or
    interpolated content.
    For an empty batch, ``forward_input_shape`` records the original, unpadded canvas for inverse replay.

Note:
    Compiled slice-mode interpolation matches eager execution to floating-point tolerance,
    not bitwise. Eager execution retains native slicing and resizing for performance;
    the tensorized compiled path avoids recompilation as crop coordinates change.

.. image:: _static/img/RandomCrop.png

See Also:
    - :class:`CenterCrop`: extracts the deterministic centered patch.
    - :class:`RandomResizedCrop`: samples a crop and resizes it to the requested output size.
    - :class:`RandomCrop3D`: samples a fixed-size subvolume.

Examples:
    >>> import torch
    >>> _ = torch.manual_seed(0)
    >>> inputs = torch.arange(1*1*3*3.).view(1, 1, 3, 3)
    >>> aug = RandomCrop((2, 2), p=1., cropping_mode="resample")
    >>> out = aug(inputs)
    >>> out
    tensor([[[[3., 4.],
              [6., 7.]]]])
    >>> aug.inverse(out, padding_mode="replicate")
    tensor([[[[3., 4., 4.],
              [3., 4., 4.],
              [6., 7., 7.]]]])

To apply the exact augmenation again, you may take the advantage of the previous parameter state:
    >>> input = torch.randn(1, 3, 32, 32)
    >>> aug = RandomCrop((2, 2), p=1., cropping_mode="resample")
    >>> (aug(input) == aug(input, params=aug._params)).all()
    tensor(True)

NFÚconstantTç      ð?Úslicec               óH   € V ^8„  d   QhRRRRRRRRR	R
RRRRRRRRRRRR
RR/# )r   ÚsizezTuple[int, int]r   z@Optional[Union[int, Tuple[int, int], Tuple[int, int, int, int]]]Úpad_if_neededzOptional[bool]r    zUnion[float, Sequence[float]]r!   r"   ÚresamplezUnion[str, int, Resample]Úsame_on_batchÚboolÚalign_cornersÚpr6   ÚkeepdimÚcropping_moder#   ÚNoner$   )r%   s   "r&   r'   ÚRandomCrop.__annotate__¡   sƒ   € ÷ 
ñ 
àð
ð Rð
ð &ð	
ð
 ,ð
ð ð
ð ,ð
ð ð
ð ð
ð ð
ð ð
ð ð
ð 
ñ
r(   c                	ó¸   <€ \         SV `  R WyV
R7       \        P                  ! V4      V n        RVRVRVRVRVR\
        P                  ! V4      RVR	V/V n        R
# )rD   )rM   rJ   Úp_batchrN   rG   r   rH   r    r!   rI   rL   rO   N)ÚsuperÚ__init__ÚrgÚCropGeneratorÚ_param_generatorr   ÚgetÚflags)ÚselfrG   r   rH   r    r!   rI   rJ   rL   rM   rN   rO   Ú	__class__s   &&&&&&&&&&&&€r&   rU   ÚRandomCrop.__init__¡   sg   ø€ ô 	‰Ñ˜3¨mÐPWÐÔXÜ "× 0Ò 0°Ó 6ˆÔà�DØ�wØ˜]Ø�DØ˜LØœŸš XÓ.Ø˜]Ø˜]ð	
ˆŽ
r(   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r2   úTuple[int, ...]rZ   úOptional[Dict[str, Any]]r#   r   r$   )r%   s   "r&   r'   rQ   ½   s#   € ÷ ñ  _ð Ð=Uð Ðajñ r(   c                	ó”  € Vf   V P                   MTp\        V4      ^8w  d   \        RV R24      h. ROpVR,          Ee,   \        VR,          \        4      '       d   VR,          .^,          pMü\        VR,          \
        4      '       dW   \        VR,          4      ^8X  d@   VR,          ^ ,          VR,          ^ ,          VR,          ^,          VR,          ^,          .pM‰\        VR,          \
        4      '       dW   \        VR,          4      ^8X  d@   VR,          ^ ,          VR,          ^,          VR,          ^,          VR,          ^,          .pM\        RVR,           R24      hVR,          '       dÍ   VR,          ^ ,          VR,          ,
          VR,          ^,          VR	,          ,
          3pV^,          ^ 8”  d;   \        V^,          V^ ,          4      V^ &   \        V^,          V^,          4      V^&   V^ ,          ^ 8”  d;   \        V^ ,          V^,          4      V^&   \        V^ ,          V^,          4      V^&   V# )
NzExpected BCHW. Got Ú.r   z9Expect `padding` to be a scalar, or length 2/4 list. Got rH   rG   )r   r   r   r   r0   r1   )rZ   ÚlenÚAssertionErrorr4   r5   ÚtupleÚRuntimeErrorr+   )r[   r2   rZ   r   Úneeded_paddings   &&&  r&   Úcompute_paddingÚRandomCrop.compute_padding½   s   € Ø#šm�—
’
°ˆÜˆu‹:˜Œ?Ü Ð#6°u°g¸QÐ!?Ó@Ð@ÚˆØ�ÕÓ'Ü˜% 	Õ*¬C×0Ò0Ø  Õ+Ð,¨qÕ0‘Ü˜E )Õ,¬e×4Ò4¼¸UÀ9Õ=MÓ9NÐRSÔ9SØ  Õ+¨AÕ.°°iÕ0@ÀÕ0CÀUÈ9ÕEUÐVWÕEXÐZ_Ð`iÕZjÐklÕZmÐn‘Ü˜E )Õ,¬e×4Ò4¼¸UÀ9Õ=MÓ9NÐRSÔ9SØ  Õ+¨AÕ.°°iÕ0@ÀÕ0CÀUÈ9ÕEUÐVWÕEXÐZ_Ð`iÕZjÐklÕZmÐn‘ä"Ð%^Ð_dÐenÕ_oÐ^pÐpqÐ#rÓsÐsà�×!Ô!Ø/4°V­}¸QÕ/?À%ÈÅ)Õ/KÈUÐSYÍ]Ð[\ÕM]Ð`eÐfhÕ`iÕMiÐ.jˆNà˜aÕ  1Ô$ä  °Õ!2°G¸AµJÓ?�˜‘
Ü  °Õ!2°G¸AµJÓ?�˜‘
à˜aÕ  1Ô$ä  °Õ!2°G¸AµJÓ?�˜‘
Ü  °Õ!2°G¸AµJÓ?�˜‘
Øˆr(   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   r   r   r   zOptional[List[int]]rZ   r`   r#   r$   )r%   s   "r&   r'   rQ   Ú   s,   € ÷ 
ñ 
Ø!ð
Ø,?ð
ØOgð
à	ñ
r(   c                	óÀ   € Vf   V P                   MTpVf   V P                  VP                  4      p\        V4      '       d   \	        WVR,          VR,          4      pV# )Nr    r!   )rZ   rh   r2   r3   r   )r[   r   r   rZ   s   &&&&r&   Úprecrop_paddingÚRandomCrop.precrop_paddingÚ   sQ   € ð $šm�—
’
°ˆØŠ?Ø×*Ñ*¨5¯;©;Ó7ˆGäˆw�<Š<Ü" 5°5¸µ=À%ÈÕBWÓXˆEàˆr(   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r   r   ÚparamsúDict[str, torch.Tensor]r#   r$   )r%   s   "r&   r'   rQ   æ   s(   € ÷ Rñ R \ð RÐ;Rð RÐWcñ Rr(   c           	     	ón  € VP                  R 4      p\        4       '       g!   \        V\        P                  4      '       gN   \        \        V P                  \        VP                  4      4      4      \        P                  R7      R,          p\        VR,          VP                  VP                  4      # )Úpadding_size©ÚdtypeN©ºNNN:NNr   )rY   r   r4   r7   ÚTensorr   re   rh   r2   Úlongr   Údevicert   )r[   r   ro   r   s   &&& r&   Ú_padding_offsetÚRandomCrop._padding_offsetæ   st   € Ø—*‘*˜^Ó,ˆÜ�>Š>¤¨G´U·\±\×!BÒ!Bä&¤u¨T×-AÑ-AÄ%ÈÏÉÓBTÓ-UÓ'VÔ^c×^hÑ^hÔiÐjnÕoˆGÜ% g¨f¥o°u·|±|ÀUÇ[Á[ÓQÐQr(   c               ó(   € V ^8„  d   QhRRRRRRRR/# ©r   r   r   ro   rp   rZ   úDict[str, Any]r#   r$   )r%   s   "r&   r'   rQ   í   s,   € ÷ ñ Ø!ðØ+BðØKYðà	ñr(   c                	ó¾   € V P                  WV4      pV P                  W4      pVR;;,          VR,          VR,          ,          P                  R4      ,          uu&   V# )rv   ©rv   ºNr   Nr   ©rv   r�   r�   ©.Nr1   )Ú_compute_crop_transformationrz   Úsqueeze)r[   r   ro   rZ   Ú	transformÚoffsets   &&&&  r&   Úcompute_transformationÚ!RandomCrop.compute_transformationí   sW   € ð ×5Ñ5°eÀUÓKˆ	à×%Ñ% eÓ4ˆØ�(× 	¨)Õ 4°v¸iÕ7HÕ H×QÑQÐRTÓUÕUÓØÐr(   c               ó(   € V ^8„  d   QhRRRRRRRR/# r}   r$   )r%   s   "r&   r'   rQ   ö   s2   € ÷ <Tñ <TØ!ð<TØ+Bð<TØKYð<Tà	ñ<Tr(   c           	     	óê	  € VR ,          R9   EdÐ   \        VR,          VP                  VP                  4      p\        VR,          VP                  VP                  4      p\        WE4      pVP	                  R4      p\        4       '       g"   \        V\        P                  4      '       Egc   VP                  RR w  r‰V P                  \        VP                  4      4      p
WŠ^,          V
^,          ,           ,          pWš^ ,          V
^,          ,           ,          p	VR,          w  r¼VR ,          R8X  d—   WÉ8”  dE   VR;;,          WÉ,          ,          uu&   VR;;,          WÉ,          ^,
          ^,          ,          uu&   W¸8”  dE   VR;;,          W¸,          ,          uu&   VR;;,          W¸,          ^,
          ^,          ,          uu&   V# W¸8”  g   WÉ8”  d7   VR;;,          WÉ,          ,          uu&   VR;;,          W¸,          ,          uu&   V# \        WqP                  4      pVP	                  R4      p\        V\        P                  4      '       d�   VP                  ^ ,          ^ 8”  di   \        WÑP                  4      pVR,          P                  VP                  ^ ,          4      pVR,          P                  VP                  ^ ,          4      pM^VP                  R,          VR,          ,           VR,          ,           pVP                  R,          VR,          ,           VR,          ,           pVR,          w  r¼W¾8„  WÏ8„  ,          p\        P                  ! VR ,          R8X  d   WÏ8„  MT\        P                  ! WüVP                  R7      VP                  VP                  R7      ,          \        P                   ! WöP                  R7      4      p\        P                  ! VR ,          R8X  d   W¾8„  MT\        P                  ! WëVP                  R7      VP                  VP                  R7      ,          \        P                   ! WæP                  R7      4      pVR;;,          V,          uu&   VR;;,          V,          uu&   VR ,          R8X  dG   VR;;,          V^,
          ^,          ,          uu&   VR;;,          V^,
          ^,          ,          uu&   V# \#        R	VR ,           R
24      h)rO   rE   ÚsrcÚdstrr   NrG   Úforward_input_shapers   úNot supported type: rb   )rI   rE   r0   )rv   r   r   )rv   r   r   )rv   é   r�   )rv   r�   r   r1   )rv   r   )rv   é   )rv   r   )rv   r�   )r   ry   rt   r   rY   r   r4   r7   rw   r2   rh   re   ÚexpandÚwhereÚ	full_likeÚtoÚ	ones_likeÚNotImplementedError)r[   r   ro   rZ   rŒ   r�   r†   rr   ÚhÚwr   Úh_outÚw_outÚcanvasÚpadded_hÚpadded_wÚneeds_scaleÚscale_wÚscale_hs   &&&&               r&   r„   Ú'RandomCrop._compute_crop_transformationö   s¢  € ð �Õ!Ð%:Õ:Ü(¨°­¸¿¹ÀeÇkÁkÓRˆCÜ(¨°­¸¿¹ÀeÇkÁkÓRˆCÜ)¨#Ó3ˆIð "Ÿ:™: nÓ5ˆLÜ�~Š~¤Z°¼e¿l¹l×%KÓ%KØ—{‘{ 2 3Ð'‘�Ø×.Ñ.¬u°U·[±[Ó/AÓB�Ø˜Q•Z '¨!¥*Õ,Õ,�Ø˜Q•Z '¨!¥*Õ,Õ,�Ø$ V�}‘�Ø˜Õ)¨WÔ4à”yØ! '×*¨e­iÕ7Ó*Ø! '×*¨u­y¸1­}ÀÕ.AÕAÓ*Ø”yØ! '×*¨e­iÕ7Ó*Ø! '×*¨u­y¸1­}ÀÕ.AÕAÓ*ð !Ð ð ”Y %¤)Ø˜g×&¨%­)Õ3Ó&Ø˜g×&¨%­)Õ3Ó&Ø Ð ä1°,ÇÁÓMˆLØ—Z‘ZÐ 5Ó6ˆFÜ˜&¤%§,¡,×/Ò/°E·K±KÀµNÀQÔ4Fô 0°¿¹ÓE�Ø! "�:×,Ñ,¨U¯[©[¸­^Ó<�Ø! "�:×,Ñ,¨U¯[©[¸­^Ó<‘à Ÿ;™; r�?¨\¸$Õ-?Õ?À,ÈtÕBTÕT�Ø Ÿ;™; r�?¨\¸$Õ-?Õ?À,ÈtÕBTÕT�Ø  �=‰LˆEØ Ñ+°Ñ0@ÕAˆKÜ—k’kØ&+¨OÕ&<ÀÔ&G�Ò!È[Ü—’ °y·±ÔGÈ(Ï+É+Ð\e×\kÑ\kÈ+ÓJlÕlÜ—’ ·±Ô@óˆGô
 —k’kØ&+¨OÕ&<ÀÔ&G�Ò!È[Ü—’ °y·±ÔGÈ(Ï+É+Ð\e×\kÑ\kÈ+ÓJlÕlÜ—’ ·±Ô@óˆGð
 �g× 'Õ)ÓØ�g× 'Õ)ÓØ�_Õ%¨Ô0Ø˜'×" w°¥{°aÕ&7Õ7Ó"Ø˜'×" w°¥{°aÕ&7Õ7Ó"àÐÜ!Ð$8¸¸Õ9OÐ8PÐPQÐ"RÓSÐSr(   c          
     ó,   € V ^8„  d   QhRRRRRRRRR	R/# )
r   r   r   ro   rp   rZ   r~   r†   úOptional[torch.Tensor]r#   r$   )r%   s   "r&   r'   rQ   4  sC   € ÷ 	nñ 	nàð	nð (ð	nð ð		nð
 *ð	nð 
ñ	nr(   c                óF   <€ VP                  4       p\        SV `	  WW4R7      # )zBTransform original keypoints without modifying the skipped branch.©r   ro   rZ   r†   )ÚclonerT   Úapply_transform_keypoint©r[   r   ro   rZ   r†   r\   s   &&&&&€r&   r¨   Ú#RandomCrop.apply_transform_keypoint4  s&   ø€ ð —‘“ˆÜ‰wÑ/°eÐRWÐ/ÓmÐmr(   c          
     ó,   € V ^8„  d   QhRRRRRRRRR	R/# )
r   r   r   ro   rp   rZ   r~   r†   r¤   r#   r$   )r%   s   "r&   r'   rQ   ?  sC   € ÷ 	iñ 	iàð	ið (ð	ið ð		ið
 *ð	ið 
ñ	ir(   c                óF   <€ VP                  4       p\        SV `	  WW4R7      # )z>Transform original boxes without modifying the skipped branch.r¦   )r§   rT   Úapply_transform_boxr©   s   &&&&&€r&   r­   ÚRandomCrop.apply_transform_box?  s%   ø€ ð —‘“ˆÜ‰wÑ*°ÈUÐ*ÓhÐhr(   c          
     ó,   € V ^8„  d   QhRRRRRRRRR	R/# )
r   r   r   ro   rp   rZ   r~   r†   r¤   r#   r$   )r%   s   "r&   r'   rQ   J  sC   € ÷ 6Tñ 6Tàð6Tð (ð6Tð ð	6Tð
 *ð6Tð 
ñ6Tr(   c           	     	ór  € R p\        4       '       g   \        4       '       d   R pMqRV9   dk   \        VR,          \        P                  4      '       dD   VR,          P                  ^ R7      P                  4       P                  4       P                  4       pVR,          R8X  Ed?   \        V\        P                  4      '       Ed   V P                  W4      P                  V4      pV P                  R8X  d   V P                  R8X  g“   \        \        P                  ! VR,          R8„  4      VP                  VP                   4      pVP"                  ^ ,          VP"                  ^ ,          8X  d   TMVP%                  4       pWgP'                  R^4      ,          pVP)                  4       pVR;;,          VR,          VR,          ,          P                  R4      ,          uu&   V P+                  WV4      pVf   V P,                  MTpVR,          R8X  dº   \        V\        P                  4      '       g   \/        R\1        V4       R	24      hVR
,          R8X  d   RpM+VR
,          R8X  d   RpMVR
,          R8X  d   RpM	VR
,          p\3        VVR,          VR,          VR,          P4                  P7                  4       VVR,          R7      # VR,          R8X  dG   \        4       '       d   \9        WR,          VR,          RR 4      # \;        WR,          VR,          4      # \=        RVR,           R	24      h)Nrr   ©ÚdimrO   rI   rD   Ú
batch_probg      à?ú0Expected the `transform` be a torch.Tensor. Got rb   r!   rC   ÚzerosÚ	replicateÚborderÚreflectÚ
reflectionrG   rL   )Úmoder!   rL   rE   rŒ   Úbilinearr�   r1   r€   r‚   rƒ   ©rv   r�   rv   )r   r   r4   r7   rw   ÚuniqueÚcpur…   Útolistrz   r•   rM   rS   r   Ú
atleast_1dry   rt   r2   r3   Úreshaper§   rl   rZ   Ú	TypeErrorÚtyper   ÚnameÚlowerr   r   r—   )	r[   r   ro   rZ   r†   rr   r‡   Úappliedr!   s	   &&&&&    r&   Úapply_transformÚRandomCrop.apply_transformJ  s¢  € ð -1ˆÜ�>Š>œ\Ÿ^š^ð  ‰LØ˜vÔ%¬*°V¸NÕ5KÌUÏ\É\×*ZÒ*ZØ! .Õ1×8Ñ8¸QÐ8Ó?×CÑCÓE×MÑMÓO×VÑVÓXˆLØ�Õ! ZÕ/´J¸yÌ%Ï,É,×4WÓ4Wà×)Ñ)¨%Ó8×;Ñ;¸IÓFˆFØ—F‘F˜c”M d§l¡l°cÔ&9ä0Ü×$Ò$ V¨LÕ%9¸CÑ%?Ó@À&Ç-Á-ÐQW×Q]ÑQ]ó�ð &-§]¡]°1Õ%5¸¿¹ÈÕ9KÔ%K™'ÐQX×Q\ÑQ\ÓQ^�Ø§/¡/°"°aÓ"8Õ8�Ø!Ÿ™Ó)ˆIØ�h× I¨iÕ$8¸6À)Õ;LÕ$L×#UÑ#UÐVXÓ#YÕYÓØ×$Ñ$ U¸%Ó@ˆà#šm�—
’
°ˆØ�Õ! ZÔ/Ü˜i¬¯©×6Ò6ÜÐ"RÔSWÐXaÓSbÐRcÐcdÐ eÓfÐfà�^Õ$¨
Ô2Ø&‘Ø�~Õ&¨+Ô5Ø'‘Ø�~Õ&¨)Ô3Ø+‘à$ ^Õ4�ä(ØØ˜(Õ#Ø�f•Ø˜:Õ&×+Ñ+×1Ñ1Ó3Ø)Ø# OÕ4ôð ð �Õ! WÔ,Ü�~Š~Ü-¨e¸Eµ]ÀEÈ&ÅMÐS]Ð_cÓdÐdÜ" 5°­-¸¸v½ÓGÐGÜ!Ð$8¸¸Õ9OÐ8PÐPQÐ"RÓSÐSr(   c          
     ó,   € V ^8„  d   QhRRRRRRRRR	R/# )
r   r   r   rZ   r~   r†   r¤   rG   zOptional[Tuple[int, int]]r#   r$   )r%   s   "r&   r'   rQ   ‚  s<   € ÷ 
ñ 
àð
ð ð
ð *ð	
ð
 (ð
ð 
ñ
r(   c           	     	ó„  € Vf   \        R4      h\        V\        P                  4      '       g   \	        R\        V4       R24      hVR,          R8X  d   RpM+VR,          R8X  d   RpMVR,          R	8X  d   R
pM	VR,          p\        VVR,          VVR,          P                  P                  4       VVR,          R7      # )Nz#`size` has to be a tuple. Got None.r´   rb   r!   rC   rµ   r¶   r·   r¸   r¹   rI   rL   )r!   rL   r¼   )	rf   r4   r7   rw   rÂ   rÃ   r   rÄ   rÅ   )r[   r   rZ   r†   rG   r!   s   &&&&& r&   Úinverse_transformÚRandomCrop.inverse_transform‚  s¿   € ð Š<ÜÐDÓEÐEÜ˜)¤U§\¡\×2Ò2ÜÐNÌtÐT]ËÐN_Ð_`ÐaÓbÐbà�Õ  JÔ.Ø"‰LØ�>Õ" kÔ1Ø#‰LØ�>Õ" iÔ/Ø'‰Là  Õ0ˆLÜ$ØØ�hÕØØ�*Õ×"Ñ"×(Ñ(Ó*Ø%Ø Õ0ô
ð 	
r(   c               ó0   € V ^8„  d   QhRRRRRRRRR	R
RR/# )r   r   r   ro   rp   rZ   r~   r†   r¤   Úkwargsr   r#   r$   )r%   s   "r&   r'   rQ   Ÿ  sF   € ÷ #ñ #àð#ð (ð#ð ð	#ð
 *ð#ð ð#ð 
ñ#r(   c                	ó  <€ \        V\        P                  4      '       dS   VP                  4       pVR;;,          \	        VR,          R,          VP
                  VP                  4      ,          uu&   V P                  V4      pVP                  4       '       g   \        SV `(  ! WW43/ VB # VR,          P                  ^ R7      P                  4       P                  4       P                  4       pVP                  4       '       d.   \        SV `(  ! WW43/ VB p\!        W‡VR,          VR,          4      # V P#                  V4      p	VR,          P                  4       p
V
R,          V^,          ,
          V^,          ,
          V
R,          V^ ,          ,
          V^,          ,
          3p\%        V	P&                  RR 4      V8w  d2   \)        V	P&                  R,          . V	P&                  ^R OVO5RR	7      h\+        V4      pVR
,          V,          VR
&   \        V\        P                  4      '       d	   WF,          MTp\        SV `(  ! W–,          WÃV3/ VB pV	P                  4       p\!        W‡VR,          VR,          4      Wæ&   V# )rv   rr   r±   r    r!   rŽ   N:r�   NNT)Úinverser³   r€   ru   r0   r1   )r4   r7   rw   r§   r   ry   rt   Ú_gater3   rT   Úinverse_inputsr½   r¾   r…   r¿   Úallr@   Útransform_tensorre   r2   r   Údict)r[   r   ro   rZ   r†   rÎ   Úto_applyrr   ÚoutÚ	in_tensorrœ   ÚunpaddedÚapplied_paramsÚapplied_transformr>   r\   s   &&&&&,         €r&   rÒ   ÚRandomCrop.inverse_inputsŸ  s#  ø€ ô �i¤§¡×.Ò.ð "Ÿ™Ó)ˆIØ�h×Ô#9Ø�~Õ& vÕ.°	×0@Ñ0@À)Ç/Á/ó$õ Óð —:‘:˜fÓ%ˆØ�|‰|�~Š~Ü‘7Ò)¨%¸ÑTÈVÑTÐTØ˜nÕ-×4Ñ4¸Ð4Ó;×?Ñ?ÓA×IÑIÓK×RÑRÓTˆØ�<‰<�>Š>Ü‘'Ò(¨¸ÑSÈFÑSˆCÜ" 3°e¸FµmÀUÈ>ÕEZÓ[Ð[ð ×)Ñ)¨%Ó0ˆ	ØÐ-Õ.×5Ñ5Ó7ˆØ˜2•J ¨a¥Õ0°<Àµ?ÕBÀFÈ2ÅJÐQ]Ð^_ÕQ`ÕD`ÐcoÐpqÕcrÕDrÐsˆÜ�—‘  Ð%Ó&¨(Ô2Ü)¨)¯/©/¸"Õ*=Ð?bÀÇÁÐQRÐSUÐAVÐ?bÐYaÑ?bÐlpÔqÐqÜ˜f›ˆØ'-¨lÕ';¸HÕ'Eˆ�|Ñ$Ü3=¸iÌÏÉ×3VÒ3V˜IÖ/Ð\eÐÜ‰gÒ$ YÕ%8¸.ÐQbÑmÐflÑmˆØ—‘Ó"ˆÜ*¨3¸eÀF½mÈUÐSaÕMbÓcˆÑØˆr(   c               ó    € V ^8„  d   QhRRRR/# )r   Úbatch_shaper_   r#   rp   r$   )r%   s   "r&   r'   rQ   Å  s   € ÷ ñ ¨oð ÐBYñ r(   c                	óX  <€ V P                  V4      p\        P                  ! . VR ,          OV^,          V^,          ,           V^,          ,           NV^,          V^ ,          ,           V^,          ,           N54      pV P                  R,          pV P                  R,          '       g•   \	        V\
        \        34      '       dy   \        V4      ^8X  di   V^ ,          V^,          8”  g   V^,          V^,          8”  d?   \        R\        V4       R\        VR,          4       R\        VR,          4       R24      h\        \        V4      \        P                  R7      P                  V^ ,          R
4      p\        ST `5  V^ ,          ^ 8X  d   TMT4      pVP                  R	V/4       V# )r�   rG   rH   zRandomCrop size z is larger than the input :r   é   Nz (padded canvas zt) with pad_if_needed=False. Pass pad_if_needed=True to pad the input up to the crop size, or crop to a smaller size.rs   rr   r1   )rh   r7   ÚSizerZ   r4   re   Úlistrc   Ú
ValueErrorr   rx   r’   rT   Úforward_parametersÚupdate)r[   rÞ   Ú	input_padÚbatch_shape_newrG   rr   Ú_paramsr\   s   &&     €r&   rä   ÚRandomCrop.forward_parametersÅ  sx  ø€ Ø×(Ñ(¨Ó5ˆ	ÜŸ*š*ðØ˜R•ðà˜A• ¨1¥Õ-°	¸!µÕ<ðð ˜A• ¨1¥Õ-°	¸!µÕ<ñó
ˆð �z‰z˜&Õ!ˆð
 —
‘
˜?×+Ô+Ü˜4¤%¬ ×/Ò/Ü�D“	˜Q”Ø�a•˜?¨1Õ-Ô-°°aµ¸?È1Õ;MÔ1Mô Ø"¤5¨£; -Ð/IÜ˜ SÕ)Ó*Ð+Ð+;¼EÀ/ÐRUÕBVÓ<WÐ;Xð Y-ð-óð ô (¬¨iÓ(8ÄÇ
Á
ÔK×RÑRÐS^Ð_`ÕSaÐceÓfˆä‘'Ñ,¸KÈ½NÈaÔ<O©[ÐUdÓeˆØ�‰˜¨Ð5Ô6Øˆr(   )rX   rZ   )N)NN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   ÚBILINEARrÄ   rU   rh   rl   rz   rˆ   r„   r¨   r­   rÇ   rË   rÒ   rä   Ú__static_attributes__Ú__classcell__)r\   s   @r&   rB   rB   8   s—   ø† ñfðV UYØ(-Ø./Ø&Ø.6×.?Ñ.?×.DÑ.DØ#Ø"ØØØ$÷
ò 
÷8÷:
õRõõ<T÷|	nò 	n÷	iò 	i÷6T÷p
÷:#ò #÷Lö r(   rB   )(Ú
__future__r   Útypingr   r   r   r   r   r	   r
   r7   Úkornia.augmentationr   rV   Ú&kornia.augmentation._2d.geometric.baser   Úkornia.augmentation.baser   Ú!kornia.augmentation.utils.helpersr   r   Úkornia.constantsr   Úkornia.core.utilsr   r   r   Úkornia.geometry.boxesr   Úkornia.geometry.keypointsr   Úkornia.geometry.transformr   r   Úkornia.geometry.transform._cropr   Ú kornia.geometry.transform.crop2dr   r@   rB   r$   r(   r&   Ú<module>rÿ      sN   ðõ$ #ç D× DÑ Dã å 6Ý NÝ <ß NÝ %ß PÑ PÝ 'Ý /ß LÝ BÝ >õô&kÐ,ö kr(   