I am using the codes of the following github project: https://github.com/SamPlvs/Object-detection-via-HOG-SVM
I was able to train my own SWM model with the "Train_HOG_SVM.py" code. Also tested it with the other attached code example and it worked quite well.
Now I wanted to ask, if its is possible to use the trained SVM model with hog.setSVMDetector
function provided by OpenCV? And if so, how do I do it?
Asked
Active
Viewed 481 times
1

Paul
- 11
- 3
-
1so... how to port a sklearn SVM to OpenCV SVM? I have no clue. I'd go investigating how each library defines the SVM and its parameters, and then check if both allow reading and setting those parameters, and potentially adapt/recalculate those parameters to suit the target library. -- who knows, maybe there's some intermediate format common to both? or someone wrote such adapter code already? – Christoph Rackwitz Jan 31 '22 at 14:16
-
Not 100% sure but afair opencv uses libSvm format. See https://stackoverflow.com/questions/23800682/convert-scikit-learn-svm-model-to-libsvm – Micka Jan 31 '22 at 17:54