data = sio.loadmat('/home/gadiraju/data/bl-slums/sat-6-full.mat')
train_X = data['train_x'].transpose()
train_Y = data['train_y'].transpose()
test_X = data['test_x'].transpose()
test_Y = data['test_y'].transpose()
annotations = data['annotations']
print train_X.shape, train_Y.shape, test_X.shape, test_Y.shape, annotations
train_X = train_X.reshape(train_X.shape[0], 28,28,4)
test_X = test_X.reshape(test_X.shape[0],28,28,4)full
print train_X.shape, test_X.shape
ix =100001#Type a number between 0 and 323,999 inclusive
imshow(np.squeeze(train_X[ix,:,:,0:3]).astype(int)) #Only seeing the RGB channels
plt.show()
#Tells what the image is
if train_Y[ix,0] == 1:
print ('Barren Land')
elif train_Y[ix,1] == 1:
print ('Trees')
elif train_Y[ix,2] == 1:
print ('Grassland')
elif train_Y[ix,3] == 1:
print ('Roads')
elif train_Y[ix,4] == 1:
print ('Buildings')
elif train_Y[ix,5] == 1:
print ('Water Body')
else:
print ('Other')
the resulting image is somewhat odd and patterned estranged, not showing actually what is labelled (in my opinion). Anybody there who knows the issue? Guess its just a minor one, but I somewhat do not notice, what it is.