def resize_to_ensure_size(image, target_height, target_width):
height, width, _ = _ImageDimensions(image, static_only=False)
#if height < target_height or width < target_width:
# Do not preserve aspect ratio
image4 = tf.expand_dims(image, 0)
image = tf.image.resize_bilinear(image4, [tf.maximum(height, target_height), tf.maximum(width, target_width)])
return image[0]
评论列表
文章目录