tensorflow-dataset-如何用tfds格式制作我们自己的数据集?



在TensorFlow教程中,我遇到了一个从TensorFlow数据集加载数据集的代码。

dataset, metadata = tfds.load('cycle_gan/horse2zebra',
with_info=True, as_supervised=True)
train_horses, train_zebras = dataset['trainA'], dataset['trainB']
test_horses, test_zebras = dataset['testA'], dataset['testB']

但是,我想加载我自己的数据集,该数据集不是来自TensorFlow数据集。 在收集了我自己的数据集后,我不知道如何加载我的数据集并将其处理为与 TensorFlow tfds 相同的格式。

任何人都可以教我怎么做吗? 我的数据集文件夹也有相同的格式:trainA,trainB,testA,testB。

请按照本教程将数据集添加到 TFDS。

https://github.com/tensorflow/datasets/blob/master/docs/add_dataset.md