In this section, we will explain the process to apply the trained model in your application. Given a face image, we detect and process each face separately. Then, we find landmarks and extract the face region. The image features are extracted and passed to kmeans to obtain a 1,000-dimensional feature vector. PCA is applied to reduce the dimension of this feature vector. The learned machine learning model is used to predict the expression of the input face.
The following figure shows the complete process to predict the facial expression of a face in an image: