Abder-Rahman Ali
2016-01-24 13:59:13 UTC
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.
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.