See

OpenCV Support Vector Machine training

Train a Support Vector Machine (SVM) model to recognize facial features using OpenCV (Computer Vision) Cpp API and Histogram of Oriented Gradients (HOG).