Own database using torchvision.datasets.ImageFolder

You can find a small example for a comparable use case here. In your case, you shouldn’t use the sampler, since you are not dealing with different persons.
Let me know, if you can adapt this code for your use case.