| 92 | // ---------------------------------------------------------------------------------------- |
| 93 | |
| 94 | inline shape_predictor train_shape_predictor_on_images_py ( |
| 95 | const py::list& pyimages, |
| 96 | const py::list& pydetections, |
| 97 | const shape_predictor_training_options& options |
| 98 | ) |
| 99 | { |
| 100 | const unsigned long num_images = py::len(pyimages); |
| 101 | if (num_images != py::len(pydetections)) |
| 102 | throw dlib::error("The length of the detections list must match the length of the images list."); |
| 103 | |
| 104 | std::vector<std::vector<full_object_detection> > detections(num_images); |
| 105 | dlib::array<numpy_image<unsigned char>> images(num_images); |
| 106 | images_and_nested_params_to_dlib(pyimages, pydetections, images, detections); |
| 107 | |
| 108 | return train_shape_predictor_on_images(images, detections, options); |
| 109 | } |
| 110 | |
| 111 | |
| 112 | inline double test_shape_predictor_with_images_py ( |
nothing calls this directly
no test coverage detected