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

Function full_obj_det_init

tools/python/src/shape_predictor.cpp:71–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71std::shared_ptr<full_object_detection> full_obj_det_init(const rectangle& rect, const py::object& pyparts_)
72{
73 try
74 {
75 auto&& pyparts = pyparts_.cast<py::list>();
76
77 const unsigned long num_parts = py::len(pyparts);
78 std::vector<point> parts;
79 for (const auto& item : pyparts)
80 parts.push_back(item.cast<point>());
81
82 return std::make_shared<full_object_detection>(rect, parts);
83 }
84 catch (py::cast_error&)
85 {
86 // if it's not a py::list it better be a vector<point>.
87 auto&& parts = pyparts_.cast<const std::vector<point>&>();
88 return std::make_shared<full_object_detection>(rect, parts);
89 }
90}
91
92// ----------------------------------------------------------------------------------------
93

Callers

nothing calls this directly

Calls 2

lenFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected