I have a bunch of training images (.jpg format) that I want to give as training input to scikit learn's SVM classifier. Any idea what's the preferred way to doing this?
For example, in the example here the image data is loaded from a predefined set and converted to a format that the SVM classifier understands in the following steps.
# The digits dataset
digits = datasets.load_digits()
# To apply an classifier on this data, we need to flatten the image, to
# turn the data in a (samples, feature) matrix:
n_samples = len(digits.images)
data = digits.images.reshape((n_samples, -1))
My question is if I've my own set of images that I want to load as a training set to the SVM classifier how should I go about converting those images into a format that the classifier will understand.
My developing on OS-X (Mavericks) but I'll run the actual code on Linux (Ubuntu)
Thanks
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments