tfm.vision.augment.SSDRandomCrop

Random crop preprocessing as in the SSD paper.

Inherits From: ImageAugment

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

params a sequence of SSDRandomCropParam that contains: min_object_covered - a float representing minimum the cropped image must cover at least this fraction with at least one of the input bounding boxes. min_box_overlap - a float representing minimum overlap of the bounding box with the cropped image to keep the box. prob_to_apply - a float representing the probability to crop.
aspect_ratio_range allowed range for aspect ratio of the cropped image.
area_range allowed range for area ratio between cropped image and the original image.

Methods

distort

View source

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

View source

See base class.