0

How could I use the Support Vector Machine in scikit for python on images I have on my disk.

I have a folder which contains images of cars in png format and I would like to run SVM to be able to classify them into 3 categories

  1. cars
  2. buses
  3. motorcycles
usmanali
  • 2,028
  • 2
  • 27
  • 38
M.Cesar
  • 89
  • 8

1 Answers1

2

Check out the digits classification tutorial from the scikit-learn website.

http://scikit-learn.org/stable/auto_examples/classification/plot_digits_classification.html

Your case is a modification of this example with three classes instead of 10

To load your own images, refer this question

Using sklearn load_files() to load images from png as data

Community
  • 1
  • 1
gokul_uf
  • 740
  • 1
  • 8
  • 21
  • What about opening multiple images at the same time.Like I have 8 images, I would like to use 4 for training and 4 for prediction. PS: I started coding in python today – M.Cesar Feb 22 '16 at 09:36
  • I think the SVM algorithm requires that the images be given one by one, this is usually done by providing the directory in which images are stored instead of the images themselves. Python is a easy to learn language, you'll be upto speed in no time. I suggest you try the google python course to learn the language, its worth it. – gokul_uf Feb 22 '16 at 14:54
  • There's a little tick beneath the upvotes, dont forget to click on it :) – gokul_uf Feb 26 '16 at 09:08