tfm.vision.preprocess_ops_3d.crop_image
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.
|
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."],[],[]]