Using Global Contrast Normalization - Python pylearn2 -
im attempting input image method, when try draw image, comes totally black.
i tried inputing 1 image , inputing whole mnist dataset. same result.
https://github.com/lisa-lab/pylearn2/blob/master/pylearn2/expr/preprocessing.py
if gcn true: trainingfolder = "../inputdata/converted_training/gcn/" testingfolder = "../inputdata/converted_testing/gcn/" img0 = (data[1,1:]).reshape((28,28)).astype('uint8')*255 im = image.fromarray(img0) im.show() #gcn# img_gcn = global_contrast_normalize(data) img_gcn_1 = image.fromarray(img_gcn[1,1:].reshape((28,28)).astype('uint8')*255) img_gcn_1.show()
the second image, img_gcn_1 comes blacked.
what doing wrong?
have tried visualize image without multiplying 255? i.e.,
import matplotlib.pyplot plt img = img_gcn[:, 0] img = img.reshape(28, 28, order='f') plt.imshow(img, cmap=plt.get_cmap('gray'))
i think procedure should work.
Comments
Post a Comment