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

WARNING: minimal feature index is 0, but indices should start from 1 #6

Open timuric opened 10 years ago

timuric commented 10 years ago

When running classify.py it gives following message: Scaling testing data... WARNING: minimal feature index is 0, but indices should start from 1 Testing... Any idea what this means or how to solve it? Thank you

shackenberg commented 10 years ago

Sorry, I am not sure what that means of the top of my head. I will look into it, but it will probably take me a while.

timuric commented 10 years ago

@shackenberg thank you

timuric commented 10 years ago

@shackenberg I found out the issue. Features in the svm file start with index 0, while svm-scale counts them from 1.

So if now the first line of the svm file looks like this: 0 0:0.000716 1:0.002190 2:0.002569 3:0.000632 4:0.001095 etc

it should look like so: 0 1:0.002190 2:0.002569 3:0.000632 4:0.001095 etc

I wonder if this affects the performance of the classifier, might be not :)

shackenberg commented 10 years ago

Thanks. But I honestly don't know why this error only popped up now.

alexandrekow commented 9 years ago

In function writeHistogramsToFile replace for i in range(nwords): by for i in range(1, nwords+1): and the error will disappear