Skip to content
Snippets Groups Projects

Remove padding value and padding token parameters from training configuration

Merged Manon Blanco requested to merge reomve-padding-parameter into main
All threads resolved!
1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
+ 2
2
@@ -34,7 +34,7 @@ def pad_images(data, padding_mode="br"):
y_lengths = [x.shape[1] for x in data]
longest_x = max(x_lengths)
longest_y = max(y_lengths)
padded_data = np.ones((len(data), longest_x, longest_y, data[0].shape[2])) * 0
padded_data = np.zeros((len(data), longest_x, longest_y, data[0].shape[2]))
for i, xy_len in enumerate(zip(x_lengths, y_lengths)):
x_len, y_len = xy_len
if padding_mode == "br":
@@ -87,7 +87,7 @@ def pad_image(
)
if not (pad_width == 0 and pad_height == 0):
padded_image = np.ones((h + pad_height, w + pad_width, c)) * 0
padded_image = np.zeros((h + pad_height, w + pad_width, c))
if padding_mode == "br":
hi, wi = 0, 0
elif padding_mode == "tl":
Loading