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.
|