MCPcopy Create free account
hub / github.com/davisking/dlib / run_predictor

Function run_predictor

tools/python/src/shape_predictor.cpp:18–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16// ----------------------------------------------------------------------------------------
17
18full_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
38void save_shape_predictor(const shape_predictor& predictor, const std::string& predictor_output_filename)
39{

Callers

nothing calls this directly

Calls 1

errorClass · 0.85

Tested by

no test coverage detected