Fixed docstrings not showing the right types.

This commit is contained in:
Davis King 2018-06-27 07:57:03 -04:00
parent d96d3a50f4
commit 8fdb3af9bf
1 changed files with 9 additions and 8 deletions

View File

@ -249,6 +249,15 @@ void save_face_chip (
void bind_face_recognition(py::module &m) void bind_face_recognition(py::module &m)
{ {
{
typedef std::vector<full_object_detection> type;
py::bind_vector<type>(m, "full_object_detections", "An array of full_object_detection objects.")
.def("clear", &type::clear)
.def("resize", resize<type>)
.def("extend", extend_vector_with_python_list<full_object_detection>)
.def(py::pickle(&getstate<type>, &setstate<type>));
}
{ {
py::class_<face_recognition_model_v1>(m, "face_recognition_model_v1", "This object maps human faces into 128D vectors where pictures of the same person are mapped near to each other and pictures of different people are mapped far apart. The constructor loads the face recognition model from a file. The model file is available here: http://dlib.net/files/dlib_face_recognition_resnet_model_v1.dat.bz2") py::class_<face_recognition_model_v1>(m, "face_recognition_model_v1", "This object maps human faces into 128D vectors where pictures of the same person are mapped near to each other and pictures of different people are mapped far apart. The constructor loads the face recognition model from a file. The model file is available here: http://dlib.net/files/dlib_face_recognition_resnet_model_v1.dat.bz2")
.def(py::init<std::string>()) .def(py::init<std::string>())
@ -278,13 +287,5 @@ void bind_face_recognition(py::module &m)
m.def("chinese_whispers_clustering", &chinese_whispers_clustering, py::arg("descriptors"), py::arg("threshold"), m.def("chinese_whispers_clustering", &chinese_whispers_clustering, py::arg("descriptors"), py::arg("threshold"),
"Takes a list of descriptors and returns a list that contains a label for each descriptor. Clustering is done using dlib::chinese_whispers." "Takes a list of descriptors and returns a list that contains a label for each descriptor. Clustering is done using dlib::chinese_whispers."
); );
{
typedef std::vector<full_object_detection> type;
py::bind_vector<type>(m, "full_object_detections", "An array of full_object_detection objects.")
.def("clear", &type::clear)
.def("resize", resize<type>)
.def("extend", extend_vector_with_python_list<full_object_detection>)
.def(py::pickle(&getstate<type>, &setstate<type>));
}
} }