I have an image dataset and I try to extract a large number of patches from every image(the number of patches is different from different images, I hope all the patches can be used). I want a new batch, not about images but patches. I try to get patches before constructing a Dataset class, but it will take a very long time. Can I have an efficient way(such as multiprocess) to get a new batch of data while training?
Any help would be greatly appreciated.