| 16 | // ---------------------------------------------------------------------------------------- |
| 17 | |
| 18 | full_object_detection run_predictor ( |
| 19 | shape_predictor& predictor, |
| 20 | py::array img, |
| 21 | const rectangle& box |
| 22 | ) |
| 23 | { |
| 24 | if (is_image<unsigned char>(img)) |
| 25 | { |
| 26 | return predictor(numpy_image<unsigned char>(img), box); |
| 27 | } |
| 28 | else if (is_image<rgb_pixel>(img)) |
| 29 | { |
| 30 | return predictor(numpy_image<rgb_pixel>(img), box); |
| 31 | } |
| 32 | else |
| 33 | { |
| 34 | throw dlib::error("Unsupported image type, must be 8bit gray or RGB image."); |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | void save_shape_predictor(const shape_predictor& predictor, const std::string& predictor_output_filename) |
| 39 | { |