I am making a TensorFlow model that can recognise images. I want to base it on mobilenet (Google | mobilenet_v2 | Kaggle) so the pictures need to be 224x224. Because of this my first layer is a tf.keras.layers.Resizing tf.keras.layers.Resizing | TensorFlow v2.16.1. Does this layer crop the images in the center or from the top?
Hi @Egbert
The answer to your question is the image is “cropped in the center”.
As you can see in the Tensorflow blog entry you shared, none of the tulips of the original photo is missing in the resized picture.
Thank you for the answer, but I am having difficulty understanding what you mean with “none of the tulips of the original photo is missing in the resized picture”. Could you tell me where it says this and/or what you mean with it so i can better understand it? In the documentation i found: “When the original aspect ratio differs from the target aspect ratio, the output image will be cropped so as to return the largest possible window in the image (of size (height, width) ) that matches the target aspect ratio.”.
Looking at the way in which the ‘offset’ is calculated as half the (total height less the crop height), it’s clear that a center crop is done. Same for width…