January 2018
Intermediate to advanced
268 pages
6h 20m
English
We use the scikit-learn package to build the SVM model and scipy for mathematical optimization tools. You can install it as follows:
$ pip install scikit-learn scipy
We start with labeled data and feed it to the OneVsOneClassifier method. We have a classify method that classifies an input image and associates a label with it.
Let's give this a trial run, shall we? Make sure you have a folder called images, where you have the training images for the three classes. Create a folder called models, where the learning models will be stored. Run the following commands on your terminal to create the features and train the classifier:
$ python create_features.py --samples bag images/bag/ --samples dress images/dress/ ...
Read now
Unlock full access