| 213 | } |
| 214 | |
| 215 | inline void train_shape_predictor ( |
| 216 | const std::string& dataset_filename, |
| 217 | const std::string& predictor_output_filename, |
| 218 | const shape_predictor_training_options& options |
| 219 | ) |
| 220 | { |
| 221 | dlib::array<array2d<unsigned char> > images; |
| 222 | std::vector<std::vector<full_object_detection> > objects; |
| 223 | load_image_dataset(images, objects, dataset_filename); |
| 224 | |
| 225 | shape_predictor predictor = train_shape_predictor_on_images(images, objects, options); |
| 226 | |
| 227 | serialize(predictor_output_filename) << predictor; |
| 228 | |
| 229 | if (options.be_verbose) |
| 230 | std::cout << "Training complete, saved predictor to file " << predictor_output_filename << std::endl; |
| 231 | } |
| 232 | |
| 233 | // ---------------------------------------------------------------------------------------- |
| 234 |
nothing calls this directly
no test coverage detected