I'm new to python and I apologize in advance if my question seems trivial.
I have a .h5 file containing pairs of images in greyscale organized in match and non-match groups. For my final purpose I need to consider each pair of images as a single image of 2 channels (where each channel is in fact an image).
To use my data I proceed like this:
I read the .h5 file putting my data in numpy arrays (I read both groups match and non-match, both with shape (50000,4096)):
with h5py.File('supervised_64x64.h5','r') as hf: match = hf.get('/match') non_match = hf.get('/non-match') np_m = np.asarray(match) np_nm = np.asarray(non_match) hf.close()
Then I try to reshape the arrays:
reshaped_data_m = np_m.reshape(250000,2,4096)
Now, if I reshape the arrays as (250000,2,4096) and then I try to show the corresponding images what I get is actually right. But I need to reshape the arrays as (25000,64,64,2) and when I try to do this I get all black images.
Can you help me? Thank you in advance!