tfm.vision.preprocess_ops.center_crop_image
Stay organized with collections
Save and categorize content based on your preferences.
Center crop a square shape slice from the input image.
tfm.vision.preprocess_ops.center_crop_image(
image, center_crop_fraction: float = CENTER_CROP_FRACTION
)
It crops a square shape slice from the image. The side of the actual crop
is 224 / 256 = 0.875 of the short side of the original image. References:
[1] Very Deep Convolutional Networks for Large-Scale Image Recognition
https://arxiv.org/abs/1409.1556
[2] Deep Residual Learning for Image Recognition
https://arxiv.org/abs/1512.03385
Args |
image
|
a Tensor of shape [height, width, 3] representing the input image.
|
center_crop_fraction
|
a float of ratio between the side of the cropped image
and the short side of the original image
|
Returns |
cropped_image
|
a Tensor representing the center cropped image.
|
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.
[[["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."],[],[]]