Skip to content
Snippets Groups Projects
Verified Commit 70e99d77 authored by Mélodie's avatar Mélodie Committed by Mélodie Boillet
Browse files

Fix padding to bottom-right

parent 1956acc9
No related branches found
No related tags found
1 merge request!224Fix version 0.2.0-dev3 and later
This commit is part of merge request !224. Comments created here will be created in the context of that merge request.
......@@ -26,11 +26,11 @@ def pad_sequences_1D(data, padding_value):
return padded_data
def pad_images(data):
def pad_images(images):
"""
Pad the images so that they are in the middle of the large padded image (tb-lr mode).
:param data: List of numpy arrays.
:return padded_data: A tensor containing all the padded images.
Pad the images so that they are at the top left of the large padded image.
:param images: List of images as torch tensors.
:return padded_images: A tensor containing all the padded images.
"""
longest_x = max([x.shape[1] for x in data])
longest_y = max([x.shape[2] for x in data])
......@@ -46,7 +46,7 @@ def pad_images(data):
top : padded_data.shape[2] - bottom,
left : padded_data.shape[3] - right,
] = image
return padded_data
return padded_images
def read_image(path):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment