Street_Excitement_14

Street_Excitement_14 t1_irmupgk wrote

u/in-your-own-words explaining nicely but I feel you lack basics, thus here are my two cents:

  1. You have 2 different entities, A. a csv file indicating path of the images and output class of the images, for each image, and B. the images itself.
  2. Maintain your sv file in a dataframe (ie in Pandas) and shuffle it.
  3. Create a new column which indicates images in that row is for training or for testing. (you can take indexes, and split them, or you can also stratified split ie take 20% test data from each class.) If you stuck, search web or ask stackoverflow. Pandas, sklearn and numpy are your friends.
  4. Now you have a dataframe that has image path, image class and train/test indicator. Using this dataframe, you can create train and test folder and copy/move corresponding images to those folder easily. You can also create two different csv file from your dataframe for train and test and save them as well.
  5. Alternatively, you can directly feed data from your dataframe to the learning algorithm. The loader function will take image path as an input, and load the image and feed the algorithm.

Do not ask for code:) As I have said, mostly pandas is your friend

1