title: Given list of image filenames for eachset,Split large dataset to train/valid/test directories?
body: <p>I am trying to split a large dataset into train/valid/test sets from <a href="https://www.vision.ee.ethz.ch/datasets_extra/food-101/" rel="nofollow noreferrer">Food101</a> dataset  for image classification </p>
  
  <p>and the structure of a dataset is like this and has all images in one folder</p>
  
  <pre><code>'',
  'Structure:',
  '----------',
  'pec/',
  '    images/',
  '        &lt;class_name&gt;/',
  '            &lt;image_id&gt;.jpg',
  '    meta/',
  '        classes.txt',
  '        labels.txt',
  '        test.json',
  '        test.txt',
  '        train.json',
  '        train.txt',
  '',
  'All images can be found in the "images" folder and are organized per class. All',
  'image ids are unique and correspond to the foodspotting.com review ids. 
  '',
  'The test/train splitting used in the experiment of our paper can be found in',
  'the "meta" directory.', (edited) ```
  
  
  
  I want to divide images dataset to train/valid/test  with the list of filenames given in train.txt and test.txt, which author used 
  
  </code></pre>
  
  <p>the Shape of train,valid, test lists:  (101, 600) , (101, 150) , 25250</p>
  
  <p>In colab ,i run following code</p>
  
  <pre><code>
  for x in range(train.shape[0]):
      for y in range(train.shape[1]):
  
       temp = train[x,y] + ".jpg"
  
       foldername = temp.split('/')[0]
  
       !mv /content/food-101/images/$temp /content/food101/train/$foldername/
  </code></pre>
  
  <p>Individually moving images by running nested loop by taking filenames in lists, is  taking forever time to create folders as there are 100100 images total so,</p>
  
  <p>I have a list of filenames for train/valid and test set but how to make them into folders so that we can feed it to image classifier in pytorch image folder format(i mean train / valid / test set are three different folders and each folder has subfolders of each class)</p>
  
  <p>Please Do tell if anyone knows how to do this please, and please I really need your help here,  THanks:smile:</p>