+
    åûjQm  ã                   ó°   € R t ^ RI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 RR.tR	 R
 lt ! R R4      t ! R R]4      t ! R R4      tR# )aq  Keypoint containers: 2D ``(x, y)`` and 3D ``(x, y, z)`` points that transform by matrices.

A container wraps one floating-point tensor of points, ``(N, 2)`` or ``(B, N, 2)`` in 2D and ``(N, 3)`` or
``(B, N, 3)`` in 3D, without copying it, and transforms it by homogeneous matrices with
:func:`~kornia.geometry.linalg.transform_points`. 2D points are ``(x, y)`` pixel coordinates, ``x`` the column and ``y``
the row, with pixel ``(0, 0)`` centred at ``(0, 0)``; see :ref:`Coordinates and sizes <coordinate-conventions>`.

Which class to use:

- 2D keypoints that follow an image through ``3 x 3`` transforms and padding, as
  :class:`~kornia.augmentation.container.AugmentationSequential` does with its ``'keypoints'`` data: :class:`Keypoints`.
- 3D points transformed by ``4 x 4`` matrices: :class:`Keypoints3D`.
- Boxes rather than points: :class:`~kornia.geometry.boxes.Boxes`.
)ÚListÚOptionalÚTupleÚUnionÚcastN©ÚSize)Ú_emit_deprecation_warning)Útransform_points)Ú_cast_to_floating_pointÚ	KeypointsÚKeypoints3Dc                ó–   € V ^8„  d   QhR\         \        P                  P                  ,          R\        P                  P                  /# )é   Ú	keypointsÚreturn)r   ÚtorchÚTensor)Úformats   "ÚUC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\kornia\geometry\keypoints.pyÚ__annotate__r   -   s3   € ÷ ñ ¤D¬¯©×);Ñ);Õ$<ð ÄÇÁ×ASÑASñ ó    c                 ó   € \        R 4      h)zËBuilding `Keypoints` or `Keypoints3D` from a list of tensors is not implemented; pass one tensor of shape `(N, 2)` or `(B, N, 2)` for `Keypoints`, `(N, 3)` or `(B, N, 3)` for `Keypoints3D` (kornia#5023).)ÚNotImplementedError)r   s   &r   Ú_merge_keypoint_listr   -   s   € Ü
ð	róð r   c                   ó˜  a € ] tR t^4t o RtR&V 3R lR lltV 3R lR ltV 3R lR lt]V 3R lR	 l4       t	]V 3R
 lR l4       t
]V 3R lR l4       t]V 3R lR l4       tR'V 3R lR lltV 3R lR ltV 3R lR ltV 3R lR ltR'V 3R lR lltV 3R lR lt]V 3R lR l4       tR'V 3R lR lltV 3R  lR! ltV 3R" lR# ltR$tV tR%# )(r   aÈ  Store (x, y) pixel keypoints, (N, 2) or (B, N, 2), to transform and pad with images.

``kp = Keypoints(points)`` wraps a floating-point ``(N, 2)`` or ``(B, N, 2)`` tensor of ``(x, y)`` pixel
coordinates without copying it, and ``kp.transform_keypoints(M)`` maps the points by ``(3, 3)`` or ``(B, 3, 3)``
matrices and returns a new :class:`Keypoints`; ``kp.to_tensor()`` returns the stored tensor. A ``(B, 3, 3)``
batch of ``B > 1`` matrices pairs matrix ``b`` with ``points[b]`` and needs ``(B, N, 2)`` points. :meth:`pad` and
:meth:`unpad` shift the points by image padding.
:class:`~kornia.augmentation.container.AugmentationSequential` accepts a :class:`Keypoints` under its
``'keypoints'`` data key and transforms it with the images, unless the pipeline contains a
:class:`~kornia.augmentation.container.VideoSequential`: such a pipeline raises ``TypeError`` for a
:class:`Keypoints` and takes ``VideoKeypoints`` or a ``(B, T, N, 2)`` tensor. To transform a plain tensor once, use
:func:`~kornia.geometry.linalg.transform_points`; for 3D points, :class:`Keypoints3D`.

Args:
    keypoints: tensor of ``(N, 2)`` or ``(B, N, 2)`` coordinates. A list of tensors is not implemented
        (see Known defects).
    raise_if_not_floating_point: ``True`` raises ``ValueError`` for a non-floating-point tensor, ``False`` casts
        it to ``float32``, or ``float64`` when that is the default dtype. Floating-point input keeps its dtype.

Convention:
    - A point is ``(x, y)`` in pixel coordinates (:ref:`Coordinates and sizes <coordinate-conventions>`), the
      frame of the :class:`~kornia.geometry.boxes.Boxes` vertices.
    - :meth:`transform_keypoints` maps a point to :math:`M [x, y, 1]^\top` and converts it back with
      :func:`~kornia.geometry.conversions.convert_points_from_homogeneous`. ``inplace=False`` returns a new
      :class:`Keypoints`; ``inplace=True`` and :meth:`transform_keypoints_` rebind ``self`` to the transformed
      tensor and return ``self``. Neither writes into the tensor that ``self`` wrapped.
    - The constructor and :meth:`from_tensor` wrap a floating-point tensor without copying it. :meth:`pad`,
      :meth:`unpad`, item assignment and ``index_put(inplace=True)`` write into the stored tensor, so they
      change the caller's tensor; call :meth:`clone` first to keep it.
    - Integer indexing selects one batch for batched input, or one point with shape ``(1, 2)`` for unbatched
      input. Scalar integer tensors follow the same rule.
    - Known defects: list input and ``to_tensor(as_padded_sequence=True)`` raise ``NotImplementedError``
      (`#5023 <https://github.com/kornia/kornia/issues/5023>`_).

See Also:
    - :class:`Keypoints3D`: ``(x, y, z)`` points, transformed by ``4 x 4`` matrices, with no padding.
    - :func:`~kornia.geometry.linalg.transform_points`: the point transform this class applies, on a plain tensor.
    - :class:`~kornia.geometry.boxes.Boxes`: boxes in the same pixel frame, with matching pad, unpad and transform
      methods.

c                ó>   <€ V ^8„  d   QhRS[ P                  RS[RR/# ©r   r   Úraise_if_not_floating_pointr   N©r   r   Úbool)r   Ú__classdict__s   "€r   r   ÚKeypoints.__annotate___   ó'   ø€ ÷ ñ ¡%§,¡,ð ÉTð Ð]añ r   c                ó†  € R V n         \        V\        4      '       d   \        V4      w  qn         \        V\        P                  P
                  4      '       g   \        R\        V4       R24      hVP                  4       '       g,   V'       d   \        RVP                   24      h\        V4      p\        VP                  4      ^ 8X  d   VP                  R4      p^VP                  u;8:  d   ^8:  d   M MVP                  RR  R8X  g   \        RVP                   R24      hVP                  ^8g  V n        Wn        R # )Nú,Input keypoints is not a torch.Tensor. Got: Ú.ú+Coordinates must be in floating point. Got z1Keypoints shape must be (N, 2) or (B, N, 2). Got éÿÿÿÿ)r(   r   )r   ©Ú_NÚ
isinstanceÚlistr   r   r   Ú	TypeErrorÚtypeÚis_floating_pointÚ
ValueErrorÚdtyper   ÚlenÚshapeÚreshapeÚndimÚ_is_batchedÚ_data©Úselfr   r   s   &&&r   Ú__init__ÚKeypoints.__init___   ó  € Ø'+ˆŒä�i¤×&Ò&Ü!5°iÓ!@ÑˆI”wä˜)¤U§[¡[×%7Ñ%7×8Ò8ÜÐJÌ4ÐPYË?ÐJ[Ð[\Ð]Ó^Ð^à×*Ñ*×,Ò,ß*Ü Ð#NÈyÏÉÐN_Ð!`ÓaÐaä/°	Ó:ˆIäˆy�‰Ó 1Ô$ð "×)Ñ)¨'Ó2ˆIà�Y—^‘^Ö( q×(¨Y¯_©_¸R¸SÐ-AÀTÔ-IÜÐPÐQZ×Q`ÑQ`ÐPaÐabÐcÓdÐdà$Ÿ>™>¨QÑ.ˆÔàŽ
r   c                óf   <€ V ^8„  d   QhRS[ S[S[S[P                  P                  3,          RR/# )r   Úkeyr   r   ©r   ÚsliceÚintr   r   )r   r!   s   "€r   r   r"   z   s1   ø€ ÷ 'ñ '™u¡U©C±·±×1CÑ1CÐ%CÕDð 'Èñ 'r   c                ó¼   € V P                   V,          pVP                  ^8X  d(   \        V\        4      '       g   VP	                  ^ 4      p\        V 4      ! VR4      # ©é   F©r7   r5   r+   ÚtupleÚ	unsqueezer.   ©r9   r>   Údatas   && r   Ú__getitem__ÚKeypoints.__getitem__z   óE   € Ø�z‰z˜#�ˆØ�9‰9˜Œ>¤*¨S´%×"8Ò"8à—>‘> !Ó$ˆDÜ�DŒz˜$ Ó&Ð&r   c                ój   <€ V ^8„  d   QhRS[ S[S[S[P                  P                  3,          RRRR/# )r   r>   Úvaluer   r   r?   )r   r!   s   "€r   r   r"   �   s9   ø€ ÷ ñ ™u¡U©C±·±×1CÑ1CÐ%CÕDð È[ð Ð]hñ r   c                ó8   € VP                   V P                   V&   V # ©N©r7   ©r9   r>   rN   s   &&&r   Ú__setitem__ÚKeypoints.__setitem__�   ó   € ØŸ+™+ˆ�
‰
�3‰Øˆr   c                óJ   <€ V ^8„  d   QhRS[ S[S[R3,          S[3,          /# )r   r   .)r   r   rA   r   )r   r!   s   "€r   r   r"   †   s&   ø€ ÷ 	ñ 	‘u™U¡3¨ 8�_©dÐ2Õ3ñ 	r   c                ó.   € V P                   P                  # )aH  Return the tensor shape used to store 2D keypoints.

Returns:
    Shape of :attr:`data`. The common layouts are ``(N, 2)`` for
    unbatched keypoints and ``(B, N, 2)`` for batched keypoints,
    where :math:`B` is the batch size, :math:`N` is the number of
    keypoints, and the final dimension stores ``(x, y)`` coordinates.
©rI   r3   ©r9   s   &r   r3   ÚKeypoints.shape…   s   € ð �y‰y�‰Ðr   c                óH   <€ V ^8„  d   QhRS[ P                   P                  /# ©r   r   ©r   r   )r   r!   s   "€r   r   r"   ’   ó   ø€ ÷ ñ ‘e—k‘k×(Ñ(ñ r   c                ó   € V P                   # )z¯Return the raw 2D keypoint coordinate tensor.

Returns:
    Tensor storing keypoint coordinates in ``(..., 2)`` format, where
    the last dimension contains ``x`` and ``y``.
rQ   rY   s   &r   rI   ÚKeypoints.data‘   ó   € ð �z‰zÐr   c                ó4   <€ V ^8„  d   QhRS[ P                  /# r\   )r   Údevice)r   r!   s   "€r   r   r"   œ   s   ø€ ÷ !ñ !™Ÿ™ñ !r   c                ó.   € V P                   P                  # )zReturns keypoints device.)r7   rc   rY   s   &r   rc   ÚKeypoints.device›   s   € ð �z‰z× Ñ Ð r   c                ó4   <€ V ^8„  d   QhRS[ P                  /# r\   ©r   r1   )r   r!   s   "€r   r   r"   ¡   s   ø€ ÷  ñ  ‘u—{‘{ñ  r   c                ó.   € V P                   P                  # )zReturns keypoints dtype.)r7   r1   rY   s   &r   r1   ÚKeypoints.dtype    s   € ð �z‰z×ÑÐr   c                óö   <€ V ^8„  d   QhRS[ S[S[P                  P                  R3,          S[S[P                  P                  ,          3,          RS[ S[P                  P                  R3,          RS[RR/# )r   Úindices.Úvaluesr   Úinplacer   )r   r   r   r   r   r    )r   r!   s   "€r   r   r"   ¥   st   ø€ ÷ !ñ !á‘u™UŸ[™[×/Ñ/°Ð4Õ5±t¹E¿K¹K×<NÑ<NÕ7OÐOÕPð!ñ ‘e—k‘k×(Ñ(¨+Ð5Õ6ð!ñ ð	!ð
 
ñ!r   c                ó(  € V'       d   V P                   MV P                   P                  4       p\        V\        4      '       d   VP	                  WP
                  4       MVP	                  W4       V'       d   V # V P                  4       pWEn         V# )a  Write keypoint coordinates at selected tensor indices.

See the Convention block on :class:`Keypoints`.

Args:
    indices: Index tuple or list accepted by ``Tensor.index_put_`` for
        the stored coordinate tensor.
    values: Replacement coordinates, either as a raw tensor or another
        :class:`Keypoints` object.
    inplace: If ``True``, update this object in place. Otherwise,
        clone the coordinates first and return a new wrapper.

Returns:
    :class:`Keypoints` object containing the updated coordinates.
)r7   Úcloner+   r   Ú
index_put_rI   )r9   rk   rl   rm   r7   Úobjs   &&&&  r   Ú	index_putÚKeypoints.index_put¥   sh   € ÷* &�—
’
¨4¯:©:×+;Ñ+;Ó+=ˆä�fœi×(Ò(Ø×Ñ˜W§k¡kÕ2à×Ñ˜WÔ-çØˆKà�j‰j‹lˆØŒ	Øˆ
r   c                óv   <€ V ^8„  d   QhRS[ P                   P                  RS[ P                   P                  /# )r   rl   r   r]   )r   r!   s   "€r   r   r"   È   s/   ø€ ÷ ñ ©U¯[©[×-?Ñ-?ð ÁEÇKÁK×DVÑDVñ r   c                ó¤   € V P                   '       d   V# VP                  ^ 4      ^8w  d   \        RVP                  ^ 4       R24      hV^ ,          # )ao  Shape a per-image ``(B, 1)`` column so it broadcasts over ``self._data[..., i]``.

The batched container indexes as ``(B, N)``, which a ``(B, 1)`` column already broadcasts over. The
unbatched ``(N, 2)`` form carries a single implicit image and indexes as ``(N,)``, so the column must
drop its batch axis, otherwise the in-place update would broadcast to ``(1, N)``.
z^Unbatched (N, 2) keypoints carry a single image, so a per-image tensor must have one row. Got r&   )r6   ÚsizeÚRuntimeError)r9   rl   s   &&r   Ú_broadcast_over_pointsÚ Keypoints._broadcast_over_pointsÈ   sX   € ð ××ÐØˆMØ�;‰;�q‹>˜QÔÜðØ—{‘{ 1“~Ð& að)óð ð �a�yÐr   c                óL   <€ V ^8„  d   QhRS[ P                   P                  RR/# ©r   Úpadding_sizer   r   r]   )r   r!   s   "€r   r   r"   Ø   s%   ø€ ÷ ñ ¡§¡× 2Ñ 2ð °{ñ r   c                ó¸  € \        VP                  4      ^8X  d   VP                  ^4      ^8X  g   \        RVP                   R24      hVP	                  V P
                  P                  R7      pV P
                  R;;,          V P                  VR,          4      ,          uu&   V P
                  R;;,          V P                  VR,          4      ,          uu&   V # )aï  Pad the keypoints in place.

See the Convention block on :class:`Keypoints`.

``padding_size`` is ordered as ``(left, right, top, bottom)``. Only ``left`` and ``top`` shift the
coordinate origin. Both the batched ``(B, N, 2)`` and the unbatched ``(N, 2)`` container are
supported; the unbatched form carries a single image, so ``padding_size`` must have exactly one row.

Args:
    padding_size: per-image padding in pixels, shaped ``(B, 4)``. A single row broadcasts across the
        batch.

ú%Expected padding_size as (B, 4). Got r&   ©rc   ©.é    ©.:NrD   N©.rD   ©.:r   é   N©r2   r3   rv   rw   Útor7   rc   rx   ©r9   r|   Úoffsets   && r   ÚpadÚKeypoints.padØ   s¬   € ô �L×&Ñ&Ó'¨1Ô,°×1BÑ1BÀ1Ó1EÈÔ1JÜÐ!FÀ|×GYÑGYÐFZÐZ[Ð\Ó]Ð]Ø—‘¨¯
©
×(9Ñ(9�Ó:ˆØ�
‰
�6×˜d×9Ñ9¸&À½/ÓJÕJÓØ�
‰
�6×˜d×9Ñ9¸&ÀÕ:JÓKÕKÓØˆr   c                óL   <€ V ^8„  d   QhRS[ P                   P                  RR/# r{   r]   )r   r!   s   "€r   r   r"   í   s%   ø€ ÷ ñ ¡%§+¡+×"4Ñ"4ð ¸ñ r   c                ó¸  € \        VP                  4      ^8X  d   VP                  ^4      ^8X  g   \        RVP                   R24      hVP	                  V P
                  P                  R7      pV P
                  R;;,          V P                  VR,          4      ,          uu&   V P
                  R;;,          V P                  VR,          4      ,          uu&   V # )a'  Undo :meth:`pad` in place.

See the Convention block on :class:`Keypoints`.

Accepts the same batched and unbatched containers and ``padding_size`` layout as :meth:`pad`.

Args:
    padding_size: per-image padding in pixels, shaped ``(B, 4)``. A single row broadcasts across the
        batch.

r~   r&   r   r€   r‚   rƒ   r„   r†   rˆ   s   && r   ÚunpadÚKeypoints.unpadí   s¬   € ô �L×&Ñ&Ó'¨1Ô,°×1BÑ1BÀ1Ó1EÈÔ1JÜÐ!FÀ|×GYÑGYÐFZÐZ[Ð\Ó]Ð]Ø—‘¨¯
©
×(9Ñ(9�Ó:ˆØ�
‰
�6×˜d×9Ñ9¸&À½/ÓJÕJÓØ�
‰
�6×˜d×9Ñ9¸&ÀÕ:JÓKÕKÓØˆr   c                óR   <€ V ^8„  d   QhRS[ P                   P                  RS[RR/# )r   ÚMrm   r   r   r   )r   r!   s   "€r   r   r"      s-   ø€ ÷ 3ñ 3¡U§[¡[×%7Ñ%7ð 3Á$ð 3ÐS^ñ 3r   c                óö   € ^VP                   u;8:  d   ^8:  d   M MVP                  RR R8w  d   \        RVP                   R24      h\        WP                  4      pV'       d	   W0n        V # \        VR4      # )as  Apply a transformation matrix to the 2D keypoints.

See the Convention block on :class:`Keypoints`.

Args:
    M: The transformation matrix to be applied, shape of ``(3, 3)`` or ``(B, 3, 3)``.
    inplace: ``True`` rebinds this object to the transformed tensor and returns it; ``False`` returns a new
        :class:`Keypoints`.

Returns:
    The transformed keypoints.

NzAThe transformation matrix shape must be (3, 3) or (B, 3, 3). Got r&   Féþÿÿÿ)r…   r…   )r5   r3   r0   r
   r7   r   )r9   r‘   rm   Útransformed_boxess   &&& r   Útransform_keypointsÚKeypoints.transform_keypoints   sn   € ð �A—F‘FÖ˜a× 1§7¡7¨2¨3 <°6Ô#9ÜÐ`Ðab×ahÑahÐ`iÐijÐkÓlÐlä,¨Q·
±
Ó;ÐßØ*ŒJØˆKäÐ*¨EÓ2Ð2r   c                óL   <€ V ^8„  d   QhRS[ P                   P                  RR/# )r   r‘   r   r   r]   )r   r!   s   "€r   r   r"     s%   ø€ ÷ 9ñ 9¡e§k¡k×&8Ñ&8ð 9¸[ñ 9r   c                ó(   € V P                  VRR7      # )z9Inplace version of :func:`Keypoints.transform_keypoints`.T©rm   ©r•   ©r9   r‘   s   &&r   Útransform_keypoints_ÚKeypoints.transform_keypoints_  ó   € à×'Ñ'¨°4Ð'Ó8Ð8r   c                óL   <€ V ^8„  d   QhRS[ P                   P                  RR/# )r   r   r   r   r]   )r   r!   s   "€r   r   r"     s%   ø€ ÷ 
ñ 
¡E§K¡K×$6Ñ$6ð 
¸;ñ 
r   c                ó   € V ! V4      # )a=  Validate and wrap a tensor of 2D keypoint coordinates.

Args:
    keypoints: Floating-point tensor in ``(N, 2)`` or ``(B, N, 2)`` format; an integer tensor
        raises ``ValueError``. The last dimension stores ``(x, y)`` coordinates.

Returns:
    New :class:`Keypoints` instance containing the input coordinates.
© ©Úclsr   s   &&r   Úfrom_tensorÚKeypoints.from_tensor  ó   € ñ �9‹~Ðr   c                óœ   <€ V ^8„  d   QhRS[ RS[S[P                  P                  S[S[P                  P                  ,          3,          /# ©r   Úas_padded_sequencer   ©r    r   r   r   r   )r   r!   s   "€r   r   r"   )  óB   ø€ ÷ ñ ©Dð ¹UÁ5Ç;Á;×CUÑCUÑW[Ñ\a×\gÑ\g×\nÑ\nÕWoÐCoÕ=pñ r   c                ó@   € V'       d   \        R4      hV P                  # )a  Cast :class:`Keypoints` to a tensor.

Args:
    as_padded_sequence: not implemented; ``True`` raises ``NotImplementedError``
        (`#5023 <https://github.com/kornia/kornia/issues/5023>`_).

Returns:
    The stored tensor itself, ``(N, 2)`` or ``(B, N, 2)``.

z×`Keypoints.to_tensor(as_padded_sequence=True)` is not implemented; it needs the keypoint-list input that `Keypoints` does not support. Call `to_tensor()` for the `(N, 2)` or `(B, N, 2)` tensor instead (kornia#5023).©r   r7   ©r9   r©   s   &&r   Ú	to_tensorÚKeypoints.to_tensor)  ó%   € ÷ Ü%ð0óð ð
 �z‰zÐr   c                ó   <€ V ^8„  d   QhRR/# )r   r   r   r¡   )r   r!   s   "€r   r   r"   <  s   ø€ ÷ 4ñ 4�{ñ 4r   c                óJ   € \        V P                  P                  4       R4      # )z/Create an independent copy of the 2D keypoints.F)r   r7   ro   rY   s   &r   ro   ÚKeypoints.clone<  s   € ä˜Ÿ™×)Ñ)Ó+¨UÓ3Ð3r   c                ó8   <€ V ^8„  d   QhRS[ P                  RR/# )r   r1   r   r   rg   )r   r!   s   "€r   r   r"   @  s   ø€ ÷ 
ñ 
™%Ÿ+™+ð 
¨+ñ 
r   c                óF   € V P                   P                  V4      V n         V # )zÚCast stored keypoint coordinates to a target dtype.

Args:
    dtype: Destination dtype for the coordinate tensor.

Returns:
    ``self``, rebound to the converted tensor; the tensor it wrapped before is not modified.
)r7   r.   )r9   r1   s   &&r   r.   ÚKeypoints.type@  s   € ð —Z‘Z—_‘_ UÓ+ˆŒ
Øˆr   ©r*   r7   r6   N©T©F)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r:   rJ   rS   Úpropertyr3   rI   rc   r1   rr   rx   rŠ   rŽ   r•   rœ   Úclassmethodr¤   r¯   ro   r.   Ú__static_attributes__Ú__classdictcell__©r!   s   @r   r   r   4   sè   ø‡ € ñ(÷Tò ÷6'ð '÷ð ð ÷	ó ð	ð ÷ó ðð ÷!ó ð!ð ÷ ó ð ÷!ò !÷Fð ÷ ð ÷*ð ÷&3ò 3÷09ð 9ð ÷
ó ð
÷ò ÷&4ð 4÷
ö 
r   c                   óÀ   a a€ ] tR tRt oRt]RV3R lR ll4       tV3R lR ltV3R lR ltV3R	 lV 3R
 llt	RV3R lV 3R lllt
V3R lR ltV3R ltRtVtV ;t# )ÚVideoKeypointsiM  a-  Video keypoints shaped ``(B, T, N, 2)``, stored internally as ``(B * T, N, 2)``.

Non-contiguous inputs are copied only when flattening requires it. Empty batches and point sets
retain their shape on conversion back to a tensor; the temporal dimension must be nonzero.

Indexing and item assignment select whole videos on the video-batch axis, as for
:class:`~kornia.geometry.boxes.VideoBoxes`: ``vk[i]`` is a one-video :class:`VideoKeypoints` whose
:meth:`to_tensor` is ``(1, T, N, 2)``, and a boolean mask has length ``B``. Index frames with ``vk.data``.
c                ó°   <€ V ^8„  d   QhRS[ S[P                  P                  S[S[P                  P                  ,          3,          RS[S[,          RR/# )r   ÚboxesÚvalidate_boxesr   rÆ   )r   r   r   r   r   r    )r   r!   s   "€r   r   ÚVideoKeypoints.__annotate__[  sN   ø€ ÷ !ñ !Ù™%Ÿ+™+×,Ñ,©d±5·;±;×3EÑ3EÕ.FÐFÕGð!ÙYaÑbfÕYgð!à	ñ!r   c           	     ó®  € Ve   \        RRRR4       \        V\        34      '       g.   VP                  4       ^8w  g   VP                  R,          ^8w  d   \        R4      hVP                  ^4      pV ! VP                  VP                  ^ 4      VP                  ^4      ,          VP                  ^4      VP                  ^4      4      4      pW4n        V# )a}  Build video keypoints from a ``(B, T, N, 2)`` tensor of ``(x, y)`` points.

The ``B`` videos of ``T`` frames are stored as ``B * T`` frames of ``N`` keypoints, and
:attr:`temporal_channel_size` records ``T``. A list, or a tensor of any other shape, raises ``ValueError``.

Args:
    boxes: the keypoints, with shape ``(B, T, N, 2)``. The name is kept for callers that pass it by keyword.
    validate_boxes: deprecated since kornia 0.9.1 and ignored; passing ``True`` or ``False`` emits a
      :class:`DeprecationWarning`, and the default ``None`` does not. Keypoints have no validity rule to check.

Returns:
    the video keypoints.

Nz.VideoKeypoints.from_tensor(validate_boxes=...)ú0.9.1z]The argument has no effect: keypoints are not validated, whatever its value; stop passing it.zTInput keypoints type is not yet supported. Please input a `BxTxNx2` tensor directly.r(   )	r	   r+   r,   Údimr3   r0   rv   r4   Útemporal_channel_size)r£   rÈ   rÉ   rÎ   Úouts   &&&  r   r¤   ÚVideoKeypoints.from_tensorZ  s°   € ð$ Ò%Ü%Ø@ØØØoô	ô �eœd˜W×%Ò%¨%¯)©)«+¸Ô*:¸e¿k¹kÈ"½oÐQRÔ>RÜÐsÓtÐtà %§
¡
¨1£Ðñ �%—-‘- §
¡
¨1£°·
±
¸1³Õ =¸u¿z¹zÈ!»}ÈeÏjÉjÐYZËmÓ\Ó]ˆØ$9Ô!Øˆ
r   c                óf   <€ V ^8„  d   QhRS[ S[S[S[P                  P                  3,          RR/# )r   r>   r   rÆ   r?   )r   r!   s   "€r   r   rÊ   ~  s2   ø€ ÷ ñ ™u¡U©C±·±×1CÑ1CÐ%CÕDð ÐIYñ r   c                óÈ  € V P                   P                  ^ ,          V P                  ,          pV P                   P                  ! W P                  .V P                   P                  R,          O5!  V,          pVP                  V P                   P                  8X  d   VP                  ^ 4      p\        V 4      ! VP                  ^ ^4      R4      pV P                  Vn        V# )a  Select videos while preserving the temporal axis, as :meth:`VideoBoxes.__getitem__` does.

An integer or scalar tensor keeps a singleton video-batch dimension. Slices, integer tensors, and boolean
tensors follow the corresponding PyTorch indexing behavior on the video-batch axis.
ºrD   NNF)r7   r3   rÎ   Úviewr5   rG   r.   Úflatten)r9   r>   Ú
batch_sizeÚselectedrÏ   s   &&   r   rJ   ÚVideoKeypoints.__getitem__~  sª   € ð —Z‘Z×%Ñ% aÕ(¨D×,FÑ,FÕFˆ
Ø—:‘:—?’? :×/IÑ/IÐaÈDÏJÉJ×L\ÑL\Ð]_ÕL`ÓaÐbeÕfˆØ�=‰=˜DŸJ™JŸO™OÔ+Ø×)Ñ)¨!Ó,ˆHÜ�4Œj˜×)Ñ)¨!¨QÓ/°Ó7ˆØ$(×$>Ñ$>ˆÔ!Øˆ
r   c                ój   <€ V ^8„  d   QhRS[ S[S[S[P                  P                  3,          RRRR/# )r   r>   rN   r   r   rÆ   r?   )r   r!   s   "€r   r   rÊ   Œ  s9   ø€ ÷ ñ ™u¡U©C±·±×1CÑ1CÐ%CÕDð È[ð Ð]mñ r   c                ó  € V P                   p\        V\        4      '       d.   VP                   V8w  d   \        RVP                    RV R24      hV P                  P
                  ^ ,          V,          VP                  P
                  ^ ,          V,          rTVP                  P                  ! WS.VP                  P
                  R,          O5!  V P                  P                  ! WC.V P                  P
                  R,          O5!  V&   V # )zñWrite whole videos, selected by ``key`` on the video-batch axis as in :meth:`__getitem__`.

A :class:`VideoKeypoints` value must have the same ``temporal_channel_size``: otherwise its frames would be
regrouped into videos of another length.
zCannot assign videos of z frames to videos of z frames.rÓ   )rÎ   r+   rÆ   r0   r7   r3   rI   rÔ   )r9   r>   rN   rv   ÚnÚms   &&&   r   rS   ÚVideoKeypoints.__setitem__Œ  sÚ   € ð ×)Ñ)ˆÜ�eœ^×,Ò,°×1LÑ1LÐPTÔ1TÜØ*¨5×+FÑ+FÐ*GÐG\Ð]aÐ\bÐbjÐkóð ð �z‰z×Ñ Õ" dÕ*¨E¯J©J×,<Ñ,<¸QÕ,?À4Õ,Gˆ1Ø?D¿z¹z¿ºÈqÐ?nÐY^×YcÑYc×YiÑYiÐjlÕYmÓ?nˆ�
‰
�Š˜Ð7 $§*¡*×"2Ñ"2°2Õ"6Ó7¸Ñ<Øˆr   c                óH   <€ V ^8„  d   QhRS[ P                   P                  /# r\   r]   )r   r!   s   "€r   r   rÊ   œ  s!   ø€ ÷ Sñ S™5Ÿ;™;×-Ñ-ñ Sr   c                ó  <€ \         SV `  R R7      p\        \        P                  P                  V4      pVP
                  ^ ,          V P                  ,          pVP                  ! W P                  .VP
                  R,          O5!  # )F)r©   rÓ   )Úsuperr¯   r   r   r   r3   rÎ   r4   )r9   rÏ   rÖ   Ú	__class__s   &  €r   r¯   ÚVideoKeypoints.to_tensorœ  se   ø€ Ü‰gÑ°5ÐÓ9ˆÜ”5—;‘;×%Ñ% sÓ+ˆØ—Y‘Y˜q•\ T×%?Ñ%?Õ?ˆ
Ø�{Š{˜:×'AÑ'AÐRÀCÇIÁIÈbÅMÓRÐRr   c                óR   <€ V ^8„  d   QhRS[ P                   P                  RS[RR/# )r   r‘   rm   r   rÆ   r   )r   r!   s   "€r   r   rÊ   ¢  s-   ø€ ÷ ñ ¡U§[¡[×%7Ñ%7ð Á$ð ÐScñ r   c                óŠ   <€ \         SV `  WR 7      pV'       d   V # \        VP                  R4      pV P                  Vn        V# )r™   F)rà   r•   rÆ   rI   rÎ   )r9   r‘   rm   rÏ   rá   s   &&& €r   r•   Ú"VideoKeypoints.transform_keypoints¢  s@   ø€ Ü‰gÑ)¨!Ð)Ó=ˆßØˆKÜ˜SŸX™X uÓ-ˆØ$(×$>Ñ$>ˆÔ!Øˆ
r   c                ó   <€ V ^8„  d   QhRR/# )r   r   rÆ   r¡   )r   r!   s   "€r   r   rÊ   ª  s   ø€ ÷ ñ Ð'ñ r   c                óp   € \        V P                  P                  4       R 4      pV P                  Vn        V# rº   )rÆ   r7   ro   rÎ   )r9   rÏ   s   & r   ro   ÚVideoKeypoints.cloneª  s.   € Ü˜TŸZ™Z×-Ñ-Ó/°Ó7ˆØ$(×$>Ñ$>ˆÔ!Øˆ
r   c                ó&   <€ V ^8„  d   Qh/ S[ ;R&   # )r   rÎ   )rA   )r   r!   s   "€r   r   rÊ   M  s   ø‡ ‚ ñ Ñò r   r¡   rP   rº   )r»   r¼   r½   r¾   r¿   rÁ   r¤   rJ   rS   r¯   r•   ro   Ú__annotate_func__rÂ   rÃ   Ú__classcell__)rá   r!   s   @@r   rÆ   rÆ   M  s`   ù‡ € ñð ÷!ñ !ó ð!÷Fð ÷ð ÷ Só S÷õ ÷ð ÷{ … r   rÆ   c                   ó&  a € ] tR tRt o RtRV 3R lR lltV 3R lR ltV 3R lR lt]V 3R	 lR
 l4       t	]V 3R lR l4       t
V 3R lR ltV 3R lR ltRV 3R lR lltV 3R lR lt]V 3R lR l4       tRV 3R lR lltV 3R lR ltRtV tR# )r   i°  a  Store (N, 3) or (B, N, 3) keypoints in (x, y, z), to transform by 4x4 matrices.

``kp = Keypoints3D(points)`` wraps a floating-point ``(N, 3)`` or ``(B, N, 3)`` tensor of ``(x, y, z)`` points
without copying it, and ``kp.transform_keypoints(M)`` maps them by ``(4, 4)`` or ``(B, 4, 4)`` matrices and returns
a new :class:`Keypoints3D`; ``kp.to_tensor()`` returns the stored tensor. Unlike :class:`Keypoints` it has no
padding, ``index_put``, ``type``, ``device`` or ``dtype``. To transform a plain tensor once, use
:func:`~kornia.geometry.linalg.transform_points`; for 2D image points, :class:`Keypoints`. The constructor validates
the tensor as :class:`Keypoints` does.

Args:
    keypoints: tensor of ``(N, 3)`` or ``(B, N, 3)`` coordinates. A list of tensors is not implemented
        (see Known defects).
    raise_if_not_floating_point: ``True`` raises ``ValueError`` for a non-floating-point tensor, ``False`` casts
        it to ``float32``, or ``float64`` when that is the default dtype. Floating-point input keeps its dtype.

Convention:
    - Integer indexing selects one batch for batched input, or one point with shape ``(1, 3)`` for unbatched
      input. Scalar integer tensors follow the same rule.
    - Known defects: list input and ``to_tensor(as_padded_sequence=True)`` raise ``NotImplementedError``;
      :meth:`pad` and :meth:`unpad` are deprecated and also raise it
      (`#5023 <https://github.com/kornia/kornia/issues/5023>`_).

See Also:
    - :class:`Keypoints`: 2D ``(x, y)`` image points, transformed by ``3 x 3`` matrices and padded with the image.
    - :func:`~kornia.geometry.linalg.transform_points`: the point transform this class applies, on a plain tensor.
    - :class:`~kornia.geometry.boxes.Boxes3D`: 3D boxes, transformed by the same ``4 x 4`` matrices.

c                ó>   <€ V ^8„  d   QhRS[ P                  RS[RR/# r   r   )r   r!   s   "€r   r   ÚKeypoints3D.__annotate__Î  r#   r   c                ó†  € R V n         \        V\        4      '       d   \        V4      w  qn         \        V\        P                  P
                  4      '       g   \        R\        V4       R24      hVP                  4       '       g,   V'       d   \        RVP                   24      h\        V4      p\        VP                  4      ^ 8X  d   VP                  R4      p^VP                  u;8:  d   ^8:  d   M MVP                  RR  R8X  g   \        RVP                   R24      hVP                  ^8g  V n        Wn        R # )Nr%   r&   r'   z1Keypoints shape must be (N, 3) or (B, N, 3). Got r(   )r(   r…   )r…   r)   r8   s   &&&r   r:   ÚKeypoints3D.__init__Î  r<   r   c                óR   <€ V ^8„  d   QhRS[ S[S[S[P                  3,          RR/# )r   r>   r   r   r?   )r   r!   s   "€r   r   rî   é  s+   ø€ ÷ 'ñ '™u¡U©C±·±Ð%=Õ>ð 'À=ñ 'r   c                ó¼   € V P                   V,          pVP                  ^8X  d(   \        V\        4      '       g   VP	                  ^ 4      p\        V 4      ! VR4      # rC   rE   rH   s   && r   rJ   ÚKeypoints3D.__getitem__é  rL   r   c                óV   <€ V ^8„  d   QhRS[ S[S[S[P                  3,          RRRR/# )r   r>   rN   r   r   r?   )r   r!   s   "€r   r   rî   ð  s3   ø€ ÷ ñ ™u¡U©C±·±Ð%=Õ>ð À}ð ÐYfñ r   c                ó8   € VP                   V P                   V&   V # rP   rQ   rR   s   &&&r   rS   ÚKeypoints3D.__setitem__ð  rU   r   c                ó    <€ V ^8„  d   QhRS[ /# r\   r   )r   r!   s   "€r   r   rî   õ  s   ø€ ÷ ñ ‘tñ r   c                ó.   € V P                   P                  # )zÒReturn the tensor shape used to store 3D keypoints.

Returns:
    Shape of :attr:`data`. The common layouts are ``(N, 3)`` and
    ``(B, N, 3)``, where the final dimension stores ``(x, y, z)``
    coordinates.
rX   rY   s   &r   r3   ÚKeypoints3D.shapeô  s   € ð �y‰y�‰Ðr   c                óH   <€ V ^8„  d   QhRS[ P                   P                  /# r\   r]   )r   r!   s   "€r   r   rî      r^   r   c                ó   € V P                   # )z¦Return the raw 3D keypoint coordinate tensor.

Returns:
    Tensor storing coordinates in ``(..., 3)`` format, with the final
    dimension ordered as ``(x, y, z)``.
rQ   rY   s   &r   rI   ÚKeypoints3D.dataÿ  ra   r   c                óL   <€ V ^8„  d   QhRS[ P                   P                  RR/# ©r   r|   r   r   r]   )r   r!   s   "€r   r   rî   	  s)   ø€ ÷ Yñ Y¡§¡× 2Ñ 2ð Y°}ñ Yr   c                ó4   € \        RRRR4       \        R4      h)úMDeprecated since 0.9.1 and never implemented: raises ``NotImplementedError``.zKeypoints3D.padNrÌ   ú_It has never been implemented: the padding layout of 3D keypoints is not defined (kornia#5023).z3`Keypoints3D.pad` is not implemented (kornia#5023).©r	   r   ©r9   r|   s   &&r   rŠ   ÚKeypoints3D.pad	  s$   € ä!ØØØØmô		
ô "Ð"WÓXÐXr   c                óL   <€ V ^8„  d   QhRS[ P                   P                  RR/# rþ   r]   )r   r!   s   "€r   r   rî     s)   ø€ ÷ [ñ [¡%§+¡+×"4Ñ"4ð [¸ñ [r   c                ó4   € \        RRRR4       \        R4      h)r   zKeypoints3D.unpadNrÌ   r  z5`Keypoints3D.unpad` is not implemented (kornia#5023).r  r  s   &&r   rŽ   ÚKeypoints3D.unpad  s$   € ä!ØØØØmô		
ô "Ð"YÓZÐZr   c                ó>   <€ V ^8„  d   QhRS[ P                  RS[RR/# )r   r‘   rm   r   r   r   )r   r!   s   "€r   r   rî     s&   ø€ ÷ /ñ /¡U§\¡\ð /¹Dð /È]ñ /r   c                óö   € ^VP                   u;8:  d   ^8:  d   M MVP                  RR R8w  d   \        RVP                   R24      h\        WP                  4      pV'       d	   W0n        V # \        VR4      # )a   Apply a transformation matrix to the 3D keypoints.

A point is mapped to :math:`M [x, y, z, 1]^\top` and converted back with
:func:`~kornia.geometry.conversions.convert_points_from_homogeneous`.

Args:
    M: The transformation matrix to be applied, shape of ``(4, 4)`` or ``(B, 4, 4)``.
    inplace: ``True`` rebinds this object to the transformed tensor and returns it, without writing into the
        tensor it wrapped; ``False`` returns a new :class:`Keypoints3D`.

Returns:
    The transformed keypoints.

NzAThe transformation matrix shape must be (4, 4) or (B, 4, 4). Got r&   Fr“   )é   r
  )r5   r3   r0   r
   r7   r   )r9   r‘   rm   Útransformeds   &&& r   r•   ÚKeypoints3D.transform_keypoints  sl   € ð �A—F‘FÖ˜a× 1§7¡7¨2¨3 <°6Ô#9ÜÐ`Ðab×ahÑahÐ`iÐijÐkÓlÐlä& q¯*©*Ó5ˆßØ$ŒJØˆKä˜;¨Ó.Ð.r   c                ó8   <€ V ^8„  d   QhRS[ P                  RR/# )r   r‘   r   r   r]   )r   r!   s   "€r   r   rî   6  s   ø€ ÷ 9ñ 9¡e§l¡lð 9°}ñ 9r   c                ó(   € V P                  VRR7      # )z;Inplace version of :func:`Keypoints3D.transform_keypoints`.Tr™   rš   r›   s   &&r   rœ   Ú Keypoints3D.transform_keypoints_6  rž   r   c                ó8   <€ V ^8„  d   QhRS[ P                  RR/# )r   r   r   r   r]   )r   r!   s   "€r   r   rî   ;  s   ø€ ÷ 
ñ 
¡E§L¡Lð 
°]ñ 
r   c                ó   € V ! V4      # )a6  Validate and wrap a tensor of 3D keypoint coordinates.

Args:
    keypoints: Floating-point tensor in ``(N, 3)`` or ``(B, N, 3)`` format; an integer tensor raises
        ``ValueError``. The last dimension stores ``(x, y, z)``.

Returns:
    New :class:`Keypoints3D` instance containing the input coordinates.
r¡   r¢   s   &&r   r¤   ÚKeypoints3D.from_tensor:  r¦   r   c                óœ   <€ V ^8„  d   QhRS[ RS[S[P                  P                  S[S[P                  P                  ,          3,          /# r¨   rª   )r   r!   s   "€r   r   rî   G  r«   r   c                ó@   € V'       d   \        R4      hV P                  # )a  Cast :class:`Keypoints3D` to a tensor.

Args:
    as_padded_sequence: not implemented; ``True`` raises ``NotImplementedError``
        (`#5023 <https://github.com/kornia/kornia/issues/5023>`_).

Returns:
    The stored tensor itself, ``(N, 3)`` or ``(B, N, 3)``.

zÛ`Keypoints3D.to_tensor(as_padded_sequence=True)` is not implemented; it needs the keypoint-list input that `Keypoints3D` does not support. Call `to_tensor()` for the `(N, 3)` or `(B, N, 3)` tensor instead (kornia#5023).r­   r®   s   &&r   r¯   ÚKeypoints3D.to_tensorG  r±   r   c                ó   <€ V ^8„  d   QhRR/# )r   r   r   r¡   )r   r!   s   "€r   r   rî   Z  s   ø€ ÷ 6ñ 6�}ñ 6r   c                óJ   € \        V P                  P                  4       R4      # )z/Create an independent copy of the 3D keypoints.F)r   r7   ro   rY   s   &r   ro   ÚKeypoints3D.cloneZ  s   € ä˜4Ÿ:™:×+Ñ+Ó-¨uÓ5Ð5r   r¸   Nr¹   rº   )r»   r¼   r½   r¾   r¿   r:   rJ   rS   rÀ   r3   rI   rŠ   rŽ   r•   rœ   rÁ   r¤   r¯   ro   rÂ   rÃ   rÄ   s   @r   r   r   °  s¤   ø‡ € ñ÷:ò ÷6'ð '÷ð ð ÷ó ðð ÷ó ð÷Yð Y÷[ð [÷/ò /÷29ð 9ð ÷
ó ð
÷ò ÷&6ö 6r   )r¿   Útypingr   r   r   r   r   r   r   Úkornia.core._compatr	   Úkornia.geometryr
   Úkornia.geometry._coordinater   Ú__all__r   r   rÆ   r   r¡   r   r   Ú<module>r     sX   ðñ$÷ 6Õ 5ã Ý å 9Ý ,Ý ?à˜Ð
&€õ÷Vñ Vôr`�Yô `÷Fl6ó l6r   