As with the shape and patch models, the simple program in train_face_detectorcpp is an example of how a face_detector object can be built and saved for later use in the tracker. It first loads the annotation data and the shape model, and sets the reference shape as the mean-centered average of the training data (that is, the identity shape of the shape_model class):