How do i combine two datasets

I have a dataset of images and I used the ImageFolder for that. I have another dataset A with the same labels as the previous. Now I want to combine them such that each label corresponds to an img and something from A. How do I do this? Help. Thanks.

You could write a new custom Dataset, pass both datasets to it and use your logic inside __getitem__ to draw the corresponding labels from your ImageFolder and datasetA.

1 Like

Thank you for this. I really appreciate it.