I am trying to train a resnet50 model with EMNIST data which is a dataset containing 300k images of letters and numbers. Resnet50 requires 3 dimensional images as its input and not grayscale so i tried to convert all the grayscale images to RGB but it isnt working like I want it too. When i view them using pyplot.imshow, the RGB image is really different from the grayscale one which is queer because these commands are actually just copy pasting the same grayscale matrix in 3 dimensions.
The 3 commands which I have tried are given below:
> resizedImageRGB = cv2.cvtColor(resizedImage,cv2.COLOR_GRAY2RGB)
> resizedImageRGB = np.repeat(resizedImage[:,:,np.newaxis],3,-1) arr =
> np.expand_dims(resizedImage, axis=2) resizedImageRGB =
> np.concatenate((arr,arr,arr), axis=2)
The grayscale and RGB image of one of the letters are given respectively: