shackenberg / Minimal-Bag-of-Visual-Words-Image-Classifier

Implementation of a content based image classifier using the bag of visual words approach in Python together with Lowe's SIFT and Libsvm.
236 stars 94 forks source link

What's the prediction result mean? #21

Open dgtlmoon opened 7 years ago

dgtlmoon commented 7 years ago

I was expecting the class name.., ie slayer


08:19 $ python classify.py -c images/codebook.file -m images/trainingdata.svm.model images/slayer/d.jpg
---------------------
## extract Sift features
extracting Sift features
gathering sift features for images/slayer/d.jpg (58, 128)
---------------------
## loading codebook from images/codebook.file
---------------------
## computing visual word histograms
---------------------
## write the histograms to file to pass it to the svm
---------------------
## test data with svm
Scaling testing data...
WARNING: minimal feature index is 0, but indices should start from 1
Testing...
Output prediction: images/trainingdata.svm.prediction
[1]
micah5 commented 5 years ago

It corresponds to a class name. You can see the mapping printed directly after training:

category      ==>  label
a ==>      2
b ==>      1
c ==>      0