Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

custom trained SVM in hog.setSVMDetector (python)

I successfully trained a svm with BOW in python (opencv 3). Now I would like to pass it to a hog with setSVMDetector. Is this possible or am I misunderstanding the use of the method? when i try to pass a trained svm to a hog detector like this:

svm = cv2.ml.SVM_create() # opencv 3.0-rc1 API
"""train svm"""
hog = cv2.HOGDescriptor()
hog.setSVMDetector(svm)

i get TypeError: _svmdetector is not a numpy array, neither a scalar

I tried saving the svm to xml and then reload it and discovered the load() method in opencv 3 and discovered the load() method of SVM is gone.

custom trained SVM in hog.setSVMDetector (python)

I successfully trained a svm with BOW in python (opencv 3). Now I would like to pass it to a hog with setSVMDetector. Is this possible or am I misunderstanding the use of the method? when i try to pass a trained svm to a hog detector like this:

svm = cv2.ml.SVM_create() # opencv 3.0-rc1 API
"""train svm"""
svm..."""
hog = cv2.HOGDescriptor()
hog.setSVMDetector(svm)

i get TypeError: _svmdetector is not a numpy array, neither a scalar

I tried saving the svm to xml and then reload it and discovered the load() method in opencv 3 and discovered the load() method of SVM is gone.