How to speed up svm.predict? <p>I'm writing a sliding window to extract features and feed it into CvSVM's predict function. However, what I've stumbled upon is that the svm.predict function is relatively slow.</p> <p>Basically the window slides thru the image with fixed stride length, on number of image scales. </p> <ul> <li>The speed traversing the image plus extracting features for each window takes around 1000 ms (1 sec).</li> <li>Inclusion of weak classifiers trained by adaboost resulted in around 1200 ms (1.2 secs)</li> <li>However when I pass the features (which has been marked as positive by the weak classifiers) to svm.predict function, the overall speed slowed down to around 16000 ms ( 16 secs )</li> <li>Trying to collect all 'positive' features first, before passing to svm.predict utilizing TBB's threads resulted in 19000 ms ( 19 secs ), probably due to the overhead needed to create the threads, etc.</li> </ul> <p>My OpenCV build was compiled to include both TBB (threading) and OpenCL (GPU) functions. </p> <p>Has anyone managed to speed up OpenCV's SVM.predict function ? </p> <p>I've been stuck in this issue for quite sometime, since it's frustrating to run this detection algorithm thru my test data for statistics and threshold adjustment.</p> <p>Thanks a lot for reading thru this !</p>