title: How to split an image dataset in X_train, y_train, X_test, y_test?
body: <p>I have a dataset like the following the structure:</p>
  
  <pre><code>Dataset/
     |
     |
     -----Pothole/
     |         |
     |         ------ umm001.jpg
     |         |
     |         ------ abd.jpg
     |         |
     |         ------ 
     |         |
     |
     |
     ----Road/
           |
           ------road005.jpg
           |
           ------ummm.jpg
           |
           ------
           |
  </code></pre>
  
  <p>I want to split this dataset into <code>X_train, y_train, X_test, y_test</code>.</p>
  
  <p>such that:</p>
  
  <pre><code>### data: shuffled and split between train and test
  (X_train, y_train), (X_test, y_test) = mnist.load_data()
  </code></pre>
  
  <p>Or,</p>
  
  <pre><code>(X_train, y_train), (X_test, y_test) = train_test_split(X,y, test_size=0.20)
  </code></pre>
  
  <p>How can I do this?</p>