Unverified Commit 7fefdea3 authored by vfdev's avatar vfdev Committed by GitHub
Browse files

Updated _meta.py docstrings (#7320)


Co-authored-by: default avatarNicolas Hug <contact@nicolas-hug.com>
parent aef00c4d
......@@ -191,6 +191,7 @@ Miscellaneous
Lambda
v2.Lambda
v2.SanitizeBoundingBox
v2.ClampBoundingBox
.. _conversion_transforms:
......@@ -212,6 +213,7 @@ Conversion
v2.ConvertImageDtype
v2.ConvertDtype
v2.ToDtype
v2.ConvertBoundingBoxFormat
Auto-Augmentation
-----------------
......
......@@ -9,6 +9,15 @@ from .utils import is_simple_tensor
class ConvertBoundingBoxFormat(Transform):
"""[BETA] Convert bounding box coordinates to the given ``format``, e.g. from "CXCYWH" to "XYXY".
.. betastatus:: ConvertBoundingBoxFormat transform
Args:
format (str or datapoints.BoundingBoxFormat): output bounding box format.
Possible values are defined by :class:`~torchvision.datapoints.BoundingBoxFormat` and
string values match the enums, e.g. "XYXY" or "XYWH" etc.
"""
_transformed_types = (datapoints.BoundingBox,)
def __init__(self, format: Union[str, datapoints.BoundingBoxFormat]) -> None:
......@@ -22,7 +31,7 @@ class ConvertBoundingBoxFormat(Transform):
class ConvertDtype(Transform):
"""[BETA] Convert a tensor image/box/mask to the given ``dtype`` and scale the values accordingly
"""[BETA] Convert input image or video to the given ``dtype`` and scale the values accordingly.
.. betastatus:: ConvertDtype transform
......@@ -63,6 +72,13 @@ ConvertImageDtype = ConvertDtype
class ClampBoundingBox(Transform):
"""[BETA] Clamp bounding boxes to their corresponding image dimensions.
The clamping is done according to the bounding boxes' ``spatial_size`` meta-data.
.. betastatus:: ClampBoundingBox transform
"""
_transformed_types = (datapoints.BoundingBox,)
def _transform(self, inpt: datapoints.BoundingBox, params: Dict[str, Any]) -> datapoints.BoundingBox:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment