Loading data and splitting

Help needed

I have 20000 images with some id assigned to it
Ex : snake1.jpg ( ye id hogya )

And for these 20k images , i have a csv file for which each id is assigned a class

Ex : Snake1.jpg ( id ) , class ( Rattlesnake)
Basically ( 20000 , 2) shape of dataframe
Total num of unique classes is 10 ( in the sense 20k images are from these 10 classes )

Now , i want to segregate these 20k images into 10 diff folder based on their respective class present in .csv file

Or is there any func in pytorch (like in tensorflow callled as flow_from_dataframe)

You could load the .csv file via e.g. pandas and copy the files using the class id, if I understand your use case correctly. PyTorch doesn’t provide utilities to copy or move data.
Alternatively, you could also write a custom Dataset and load the files using your custom logic as described here.

Thank you for your quick response @ptrblck. I shall do the same now. :slight_smile: