所以我的图像在一个 numpy 数组中,但不在目录中。我有一个最终的 numpy 数组,它是一个 4d 形状的张量(样本、48、48、1)。我的目标是使用 keras 的图像数据生成器将它们转换为 (sample, 224, 224, 1)。请指导我如何做,因为到目前为止我已经看到人们从加载实际图像的目录中使用图像数据生成器的例子。
我已存储4个numpy的阵列localy train_images.npy,train_labels.npy,test_images.npy和test_labels.npy。
这些 numpy 中图像的形状是这些 numpy 中(sample, 48, 48, 1)
标签的形状,(sample, number of classes)因为我已经将它们转换为keras.utils.np_utils.to_categorical方法。