I am now working on a project about human body detection. In the project, I would like to use HOG descriptor which is written by my own using C++ to extract features from images 400 positive samples and 1000 negative samples which are obtained from the INRIA person dataset and write a dat file to record the feature vectors. The format of my dat file is as follows:

[class label] [the index of the feature vector]:[the value of the feature vector] ....

For example if we have a HOG vector extracted from a positive sample [0 0 0 0 0.1994464 0.174701 ....], the dat file would be written as follows:

+1 4:0.194464 5:0.174701 13:0.163949 14:0.159226 22:0.321403 23:0.298222 31:0.260821

Are there any mistakes in my dat file format? Moreover, the dimension of a feature vector may be quite long of which the length can be over 3000. Is that a problem and I need to reduce the length of the vector using principle component analysis?

Then, I use the command "svm_learn example1/train.dat example1/model" where "example1" is the folder storing the dat file and model is the output file of the command. However, no output files generated from the command. Is the command correct? I have read the manual and it mentions that the command is "svm_learn [options] example_file model_file", what options should I input?

Thank you very much!

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.