View source on GitHub
|
Random crop preprocessing as in the SSD paper.
Inherits From: ImageAugment
tfm.vision.augment.SSDRandomCrop(
params: (Sequence[configs.SSDRandomCropParam] | None) = None,
aspect_ratio_range: tuple[float, float] = (0.5, 2.0),
area_range: tuple[float, float] = (0.1, 1.0)
)
Liu et al., SSD: Single shot multibox detector https://arxiv.org/abs/1512.02325
The implementation originated from TF Object Detection API: https://github.com/tensorflow/models/blob/f36581036d3346a9496de06c8fd678d23cfe2103/research/object_detection/core/preprocessor.py#L3529
Methods
distort
distort(
image: tf.Tensor
) -> tf.Tensor
Given an image tensor, returns a distorted image with the same shape.
Expect the image tensor values are in the range [0, 255].
| Args | |
|---|---|
image
|
Tensor of shape [height, width, 3] or
[num_frames, height, width, 3] representing an image or image sequence.
|
| Returns | |
|---|---|
The augmented version of image.
|
distort_with_boxes
distort_with_boxes(
image: tf.Tensor, bboxes: tf.Tensor
) -> tuple[tf.Tensor, tf.Tensor]
See base class.
View source on GitHub