-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Various doc enhancements #7326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various doc enhancements #7326
Changes from all commits
14c73ff
470ac9c
6d6063a
0a2407f
b0999a9
4f481dd
3602052
1529d95
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
|
||
|
||
class ConvertBoundingBoxFormat(Transform): | ||
"""[BETA] Convert bounding box coordinates to the given ``format``, e.g. from "CXCYWH" to "XYXY". | ||
"""[BETA] Convert bounding box coordinates to the given ``format``, eg from "CXCYWH" to "XYXY". | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. e.g. here, had to remove full dot |
||
|
||
.. betastatus:: ConvertBoundingBoxFormat transform | ||
|
||
|
@@ -18,6 +18,7 @@ class ConvertBoundingBoxFormat(Transform): | |
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: | ||
|
@@ -79,6 +80,7 @@ class ClampBoundingBox(Transform): | |
.. betastatus:: ClampBoundingBox transform | ||
|
||
""" | ||
|
||
_transformed_types = (datapoints.BoundingBox,) | ||
|
||
def _transform(self, inpt: datapoints.BoundingBox, params: Dict[str, Any]) -> datapoints.BoundingBox: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -223,13 +223,15 @@ def _transform(self, inpt: Any, params: Dict[str, Any]) -> Any: | |
|
||
|
||
class ToDtype(Transform): | ||
"""[BETA] Converts the input to a specific dtype. | ||
"""[BETA] Converts the input to a specific dtype - this does not scale values. | ||
|
||
.. betastatus:: ToDtype transform | ||
|
||
Args: | ||
dtype (dtype or dict of Datapoint -> dtype): The dtype to convert to. A dict can be passed to specify | ||
per-datapoint conversions, e.g. ``dtype={datapoints.Image: torch.float32, datapoints.Video: torch.float64}``. | ||
dtype (``torch.dtype`` or dict of ``Datapoint`` -> ``torch.dtype``): The dtype to convert to. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wrapping in double quotes seems to fix the sad formatting you noticed @pmeier . We should fix those on the rest of the docs |
||
A dict can be passed to specify per-datapoint conversions, e.g. | ||
``dtype={datapoints.Image: torch.float32, datapoints.Video: | ||
torch.float64}``. | ||
""" | ||
|
||
_transformed_types = (torch.Tensor,) | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -11,7 +11,7 @@ | |||||
|
||||||
|
||||||
class PILToTensor(Transform): | ||||||
"""[BETA] Convert a ``PIL Image`` to a tensor of the same type. | ||||||
"""[BETA] Convert a PIL Image to a tensor of the same type - this does not scale values. | ||||||
|
||||||
.. betastatus:: PILToTensor transform | ||||||
|
||||||
|
@@ -27,7 +27,8 @@ def _transform(self, inpt: PIL.Image.Image, params: Dict[str, Any]) -> torch.Ten | |||||
|
||||||
|
||||||
class ToImageTensor(Transform): | ||||||
"""[BETA] Convert a tensor or an ndarray or PIL Image to :class:`~torchvision.datapoints.Image`. | ||||||
"""[BETA] Convert a tensor, ndarray, or PIL Image to :class:`~torchvision.datapoints.Image` | ||||||
; this does not scale values. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consistency with all other docstrings.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I went for |
||||||
|
||||||
.. betastatus:: ToImageTensor transform | ||||||
|
||||||
|
@@ -43,7 +44,7 @@ def _transform( | |||||
|
||||||
|
||||||
class ToImagePIL(Transform): | ||||||
"""[BETA] Convert a tensor or an ndarray to PIL Image. | ||||||
"""[BETA] Convert a tensor or an ndarray to PIL Image - this does not scale values. | ||||||
|
||||||
.. betastatus:: ToImagePIL transform | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain what is happening?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
honestly I have no idea.