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.