Crops the image sequence of images.
tfm.vision.preprocess_ops_3d.crop_image(
frames: tf.Tensor,
target_height: int,
target_width: int,
random: bool = False,
num_crops: int = 1,
seed: Optional[int] = None
) -> tf.Tensor
If requested size is bigger than image size, image is padded with 0. If not
random cropping, a central crop is performed if num_crops is 1.
Args |
frames
|
A Tensor of dimension [timesteps, in_height, in_width, channels].
|
target_height
|
Target cropped image height.
|
target_width
|
Target cropped image width.
|
random
|
A boolean indicating if crop should be randomized.
|
num_crops
|
Number of crops (support 1 for central crop and 3 for 3-crop).
|
seed
|
A deterministic seed to use when random cropping.
|
Returns |
A Tensor of shape [timesteps, out_height, out_width, channels] of type uint8
with the cropped images.
|