padding_for_ratio
- hybrid_learning.datasets.transforms.image_transforms.padding_for_ratio(from_size, to_ratio)[source]
Return the int padding for an image of size
(height, width)
to get a(width / height)
ratio ofratio
. Output can be used fortorch.nn.functional.pad()
pad argument.