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

Function images_and_nested_params_to_dlib

tools/python/src/conversion.h:18–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16
17template <typename image_array, typename param_type>
18void images_and_nested_params_to_dlib(
19 const py::object& pyimages,
20 const py::object& pyparams,
21 image_array& images,
22 std::vector<std::vector<param_type>>& params
23)
24{
25 // Now copy the data into dlib based objects.
26 py::iterator image_it = pyimages.begin();
27 py::iterator params_it = pyparams.begin();
28
29 for (unsigned long image_idx = 0; image_it != pyimages.end() && params_it != pyparams.end(); ++image_it, ++params_it, ++image_idx)
30 {
31 for (py::iterator param_it = params_it->begin(); param_it != params_it->end(); ++param_it)
32 params[image_idx].push_back(param_it->cast<param_type>());
33
34 assign_image(images[image_idx], image_it->cast<py::array>());
35 }
36}
37
38#endif // DLIB_PYTHON_CONVERSION_H__

Calls 4

assign_imageFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45