I am working with AT&T face dataset. There are 40 folders each containing 10 images of a person.
I can easily get an image of random class by using:
d = datasets.ImageFolder('./data/')
data = random.choice(d.samples)
label = data[1]

Now I need to pair this image with an (i)th sample image of another class, (say 34th) , but on trying to access a particular image from samples does not work. I know we can randomly iterate through sample and check if desired class image is found but that method seems inefficient.
So, is there a way to access an image of a particular class manually rather than randomly choosing images ?