0

I have an MxNet array representing 4 sequences, each formed by 5 RGB images with dimension (224x224), so that the batch shape is:

total_batch.shape = (4, 5, 224, 224, 3)

This is just for a visual representation (each square is a 224x224x3 array):

original batch

then, I have a list (new_images) of 4 new images:

new images

I need to concatenate these arrays, so that the first image in every sequence is removed...so, the output should look like:

final batch

So far, I tried:

for counter, _ in enumerate(batch_buffer):
    batch[counter] = mx.nd.concat(batch[counter][1:], mx.nd.expand_dims(new_images[counter], axis=0), dim=0)

but it's not working properly. The shape of the resulting array is correct (4, 5, 224, 224, 3) and the last image is appended, but the first 4 images in every sequence are completely black. Am I doing something wrong?

Carlo
  • 1,321
  • 12
  • 37

0 Answers0