I have an array of numpy batchforms (32,5). Each element of the package consists of a numpy array batch_elem = [s,_,_,_,_], where it s = [img,val1,val2]is a three-dimensional numpy array and _are simply scalar values.
imgis an image (numpy array) with dimensions(84,84,3)
I would like to create a numpy array with a form (32,84,84,3). Basically I want to extract the image information in each batchand convert it into a 4-dimensional array.
I tried the following:
b = np.vstack(batch[:,0])
Now I would like to access the images (first index in the second dimension)
img_batch = b[:,0]
How can I get better access to image data and get a form (32,84,84,3)?
Note:
s = b[0]
Edit:
This should be a minimal example:
img = np.zeros([5,5,3])
s = np.array([img,1,1])
batch_elem = np.array([s,1,1,1,1])
batch = np.array([batch_elem for _ in range(32)])