当我尝试对5,000张图片执行rgb到Lab的操作时:
import cv2
X =[]
Y =[]
for img in img_arr:
X.append(img[:,:,0])
Y.append(img[:,:,1:] / 128) #A and B values range from -127 to 128,
#so we divide the values by 128 to restrict values to between -1 and 1.
X = np.array(X)
Y = np.array(Y)
X = X.reshape(X.shape+(1,)) #dimensions to be the same for X and Y
print(X.shape)
print(Y.shape)
我的colab崩溃了。 我正在尝试制作一个神经网络,将输入作为图像的l通道,将a * b作为输出以比较误差,但我无法获得5,000张图像的阵列。还有其他选择吗?