Just remembered that I have an example notebook for reading MNIST into NumPy arrays, maybe that helps:
http://nbviewer.jupyter.org/github/rasbt/pattern_classification/blob/master/data_collecting/reading_mnist.ipynb > On Jan 24, 2016, at 8:59 AM, Abder-Rahman Ali <abder.rahman....@gmail.com> > wrote: > > Hi, > > > > I have read the images from my local directory as follows: > > from PIL import Image > import > os > > root > = '/Users/xyz/Desktop/data' > > > > for path, subdirs, files in os.walk(root): > > > for name in files: > > img_path > = os.path.join(path,name) > I have two subdirectories: category-1 and category-2, each of which contains > image files (.jpg) that belong to each category. > > How can I use those images and two categories with the train_test_split() > function in Scikit-Learn? In other words, to arrange the training and testing > data? > > Thanks. > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140_______________________________________________ > Scikit-learn-general mailing list > Scikit-learn-general@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/scikit-learn-general ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 _______________________________________________ Scikit-learn-general mailing list Scikit-learn-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/scikit-learn-general