1 2 3 4 5 6 7 8 9 10 |
# image data shape (7438, 1, 28, 28) # 7438samples, 1ch, 28x28 import cv2 n = train_x[0][0].astype(np.float_) n = np.log(n + 1.) * (255. / math.log(256)) n = n.astype(np.uint8) # float to uint8 plt.gray() plt.imshow(n, cmap='gray') plt.show() |