dgs.utils.image.CustomResize¶
- class dgs.utils.image.CustomResize(*args: Any, **kwargs: Any)[source]¶
Resize image, bbox and key points with this custom transform.
The image and bbox are resized using regular torch resize transforms.
Methods
- __init__(*args: Any, **kwargs: Any) None ¶
- forward(*args, **kwargs) dict[str, any] [source]¶
Resize image, bbox and key points in one go.
- Keyword Arguments:
image – One single image as tv_tensors.Image of shape
[B x C x H x W]
box – tv_tensors.BoundingBoxes in XYWH box_format of shape
[N x 4]
, with N detections.keypoints – The joint coordinates in global frame as
[N x J x 2|3]
output_size – (h, w) as target height and width of the image
- Returns:
Will overwrite the image, bbox, and key points with the newly computed values. Key Points will be in local image coordinates.
The new shape of the images is
[B x C x h x w]
.
Attributes
Original height of the image
Original width of the image
New height of the image
New width of the image