Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Read svm data and re-train with more data

I am implementing a facial expression recognition and am using SVM to classify given expression. When I train, I use this command line

svm.train(myFeatureVector,myLabels,Mat(),Mat(), myParameters);
svm.save("myClassifier.yml");

which will later when I will predict using

response = svm.predict(incomingFeatureVector);

But then when I want to train more than once (exited the program and start again), it seems to have overwritten my previous svm file. Is there any way I could do read previous svm file and add more data into it (and then resave it ,etc) ? I looked up on this openCV documentation and found nothing. However, when I read on this page; there is a method called CvSVM::read. I don't know what that does/how to implement it.

Hope anyone can help me :(

click to hide/show revision 2
retagged

updated 2014-10-07 02:52:18 -0500

berak gravatar image

Read svm data and re-train with more data

I am implementing a facial expression recognition and am using SVM to classify given expression. When I train, I use this command line

svm.train(myFeatureVector,myLabels,Mat(),Mat(), myParameters);
svm.save("myClassifier.yml");

which will later when I will predict using

response = svm.predict(incomingFeatureVector);

But then when I want to train more than once (exited the program and start again), it seems to have overwritten my previous svm file. Is there any way I could do read previous svm file and add more data into it (and then resave it ,etc) ? I looked up on this openCV documentation and found nothing. However, when I read on this page; there is a method called CvSVM::read. I don't know what that does/how to implement it.

Hope anyone can help me :(