About Dataset function to load data

Assume I have two folder, 0 folder and 1 folder. They have 1,000,000,000 images. It is out of range about list and np,array.
How could i write my dataset function? I have no idea to iterate two folder to get those images. i thought using folder name to determine lable 0 or 1.
Any one has advice? Please Help!

Check ImageFolder from torchvision.
I think it does what you want

Thanks, this one helps a lot!!