tfm.vision.augment.translate_bbox
Equivalent of PIL Translate in X/Y dimension that shifts image and bbox.
tfm.vision.augment.translate_bbox(
image, bboxes, pixels, replace, shift_horizontal
)
Args |
image
|
3D uint8 Tensor.
|
bboxes
|
2D Tensor that is a list of the bboxes in the image. Each bbox
has 4 elements (min_y, min_x, max_y, max_x) of type float with values
between [0, 1].
|
pixels
|
An int. How many pixels to shift the image and bboxes
|
replace
|
A one or three value 1D tensor to fill empty pixels.
|
shift_horizontal
|
Boolean. If true then shift in X dimension else shift in
Y dimension.
|
Returns |
A tuple containing a 3D uint8 Tensor that will be the result of translating
image by pixels. The second element of the tuple is bboxes, where now
the coordinates will be shifted to reflect the shifted image.
|
Raises |
ValueError if applied to video.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-02-02 UTC.
[null,null,["Last updated 2024-02-02 UTC."],[],[]]