Skip to content

Commit 100d571

Browse files
committed
Fix doc job, I think
1 parent df95e89 commit 100d571

File tree

3 files changed

+30
-19
lines changed

3 files changed

+30
-19
lines changed

torchvision/transforms/v2/_meta.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class ClampKeyPoints(Transform):
4040
"""Clamp keypoints to their corresponding image dimensions.
4141
4242
The clamping is done according to the keypoints' ``canvas_size`` meta-data.
43-
4443
"""
4544

4645
_transformed_types = (tv_tensors.KeyPoints,)

torchvision/transforms/v2/functional/_meta.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ def clamp_keypoints(
450450
inpt: torch.Tensor,
451451
canvas_size: Optional[tuple[int, int]] = None,
452452
) -> torch.Tensor:
453+
"""See :func:`~torchvision.transforms.v2.ClampKeyPoints` for details."""
453454
if not torch.jit.is_scripting():
454455
_log_api_usage_once(clamp_keypoints)
455456

torchvision/tv_tensors/_keypoints.py

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,44 @@
1111
class KeyPoints(TVTensor):
1212
""":class:`torch.Tensor` subclass for tensors with shape ``[..., 2]`` that represent points in an image.
1313
14-
Each point is represented by its XY coordinates.
14+
Each point is represented by its X and Y coordinates along the width and height dimensions, respectively.
1515
1616
KeyPoints can be converted from :class:`torchvision.tv_tensors.BoundingBoxes`
1717
by :func:`torchvision.transforms.v2.functional.convert_bounding_boxes_to_points`.
1818
1919
KeyPoints may represent any object that can be represented by sequences of 2D points:
20-
- `Polygonal chains<https://en.wikipedia.org/wiki/Polygonal_chain>`, including polylines, Bézier curves, etc.,
21-
which should be of shape ``[N_chains, N_points, 2]``, which is equal to ``[N_chains, N_segments + 1, 2]``
22-
- Polygons, which should be of shape ``[N_polygons, N_points, 2]``, which is equal to ``[N_polygons, N_sides, 2]``
23-
- Skeletons, which could be of shape ``[N_skeletons, N_bones, 2, 2]`` for pose-estimation models
2420
25-
.. note::
21+
- `Polygonal chains <https://en.wikipedia.org/wiki/Polygonal_chain>`_,
22+
including polylines, Bézier curves, etc., which should be of shape
23+
``[N_chains, N_points, 2]``, which is equal to ``[N_chains, N_segments +
24+
1, 2]``
25+
- Polygons, which should be of shape ``[N_polygons, N_points, 2]``, which is
26+
equal to ``[N_polygons, N_sides, 2]``
27+
- Skeletons, which could be of shape ``[N_skeletons, N_bones, 2, 2]`` for
28+
pose-estimation models
2629
27-
Like for :class:`torchvision.tv_tensors.BoundingBoxes`, there should only ever be a single
28-
instance of the :class:`torchvision.tv_tensors.KeyPoints` class per sample
29-
e.g. ``{"img": img, "poins_of_interest": KeyPoints(...)}``,
30-
although one :class:`torchvision.tv_tensors.KeyPoints` object can contain multiple key points
30+
.. note::
31+
Like for :class:`torchvision.tv_tensors.BoundingBoxes`, there should
32+
only be a single instance of the
33+
:class:`torchvision.tv_tensors.KeyPoints` class per sample e.g.
34+
``{"img": img, "poins_of_interest": KeyPoints(...)}``, although one
35+
:class:`torchvision.tv_tensors.KeyPoints` object can contain multiple
36+
key points
3137
3238
Args:
33-
data: Any data that can be turned into a tensor with :func:`torch.as_tensor`.
34-
canvas_size (two-tuple of ints): Height and width of the corresponding image or video.
35-
dtype (torch.dtype, optional): Desired data type of the bounding box. If omitted, will be inferred from
36-
``data``.
37-
device (torch.device, optional): Desired device of the bounding box. If omitted and ``data`` is a
38-
:class:`torch.Tensor`, the device is taken from it. Otherwise, the bounding box is constructed on the CPU.
39-
requires_grad (bool, optional): Whether autograd should record operations on the bounding box. If omitted and
40-
``data`` is a :class:`torch.Tensor`, the value is taken from it. Otherwise, defaults to ``False``.
39+
data: Any data that can be turned into a tensor with
40+
:func:`torch.as_tensor`.
41+
canvas_size (two-tuple of ints): Height and width of the corresponding
42+
image or video.
43+
dtype (torch.dtype, optional): Desired data type of the bounding box. If
44+
omitted, will be inferred from ``data``.
45+
device (torch.device, optional): Desired device of the bounding box. If
46+
omitted and ``data`` is a :class:`torch.Tensor`, the device is taken
47+
from it. Otherwise, the bounding box is constructed on the CPU.
48+
requires_grad (bool, optional): Whether autograd should record
49+
operations on the bounding box. If omitted and ``data`` is a
50+
:class:`torch.Tensor`, the value is taken from it. Otherwise,
51+
defaults to ``False``.
4152
"""
4253

4354
canvas_size: tuple[int, int]

0 commit comments

Comments
 (0)