tfm.vision.spatial_transform_ops.bilinear_resize_with_crop_and_pad
Stay organized with collections
Save and categorize content based on your preferences.
Bilinear resizes the images, then crops and finally pads to output size.
tfm.vision.spatial_transform_ops.bilinear_resize_with_crop_and_pad(
images: tf.Tensor,
rescale_size: tf.Tensor,
crop_offset: tf.Tensor,
crop_size: tf.Tensor,
output_size: tf.Tensor
) -> tf.Tensor
Args |
images
|
A tensor in shape (batch_size, input_h, input_w, ...) with arbitrary
numbers of channel dimensions.
|
rescale_size
|
An int tensor in shape (batch_size, 2), representing the sizes
of the rescaled images.
|
crop_offset
|
An int tensor in shape (batch_size, 2), representing the
left-top offset of the crop box. Applying negative offsets means adding
extra margins at the left-top.
|
crop_size
|
An int tensor in shape (batch_size, 2), representing the sizes of
the cropped images.
|
output_size
|
The size of the output image in (output_h, output_w).
|
Returns |
A tensor in shape (batch_size, output_h, output_w, ...). The result has the
same dtype as the input if it's float32, float16, bfloat16, otherwise the
result is float32.
|
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.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-02-02 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-02-02 UTC."],[],[]]