Hi,

I have read the images from my local directory as follows:

from PIL import Imageimport 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()
<http://scikit-learn.org/stable/modules/generated/sklearn.cross_validation.train_test_split.html>
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

Reply via email to