Assume that I create two datasets that differ by their “getitem” protocol (for example, “dataset1” in the code below gives a denoised version of every image in the original dataset and “dataset2” in the code below gives the original version of the image), and want to create a new dataset, which consists of the first 10 images from the first dataset, and the first 10 images from the second dataset. Trying to run the code below indeed gives a new dataset, but it does not preserve all the variables of the original datasets (such as classes, samples, etc…) that are required for the loading part.
How can I solve this problem?
Thanks!

dataset1 = DatasetFolder1(parameters)
dataset2 = DatasetFolder2(parameters)
dataset = [dataset1[i] for i in range(20) ]
for i in [10:20]:
dataset[i] =dataset2[i]