Commit 87aa290c authored by Davis King's avatar Davis King

Fixed pybind11 not doing the overload resolution correctly on the…

Fixed pybind11 not doing the overload resolution correctly on the cnn_face_detector's operator() in Python.
parent 939e9670
...@@ -64,7 +64,7 @@ public: ...@@ -64,7 +64,7 @@ public:
} }
std::vector<std::vector<mmod_rect> > detect_mult ( std::vector<std::vector<mmod_rect> > detect_mult (
py::list& imgs, py::list imgs,
const int upsample_num_times, const int upsample_num_times,
const int batch_size = 128 const int batch_size = 128
) )
...@@ -140,6 +140,12 @@ void bind_cnn_face_detection(py::module& m) ...@@ -140,6 +140,12 @@ void bind_cnn_face_detection(py::module& m)
{ {
py::class_<cnn_face_detection_model_v1>(m, "cnn_face_detection_model_v1", "This object detects human faces in an image. The constructor loads the face detection model from a file. You can download a pre-trained model from http://dlib.net/files/mmod_human_face_detector.dat.bz2.") py::class_<cnn_face_detection_model_v1>(m, "cnn_face_detection_model_v1", "This object detects human faces in an image. The constructor loads the face detection model from a file. You can download a pre-trained model from http://dlib.net/files/mmod_human_face_detector.dat.bz2.")
.def(py::init<std::string>()) .def(py::init<std::string>())
.def(
"__call__",
&cnn_face_detection_model_v1::detect_mult,
py::arg("imgs"), py::arg("upsample_num_times")=0, py::arg("batch_size")=128,
"takes a list of images as input returning a 2d list of mmod rectangles"
)
.def( .def(
"__call__", "__call__",
&cnn_face_detection_model_v1::detect, &cnn_face_detection_model_v1::detect,
...@@ -147,12 +153,6 @@ void bind_cnn_face_detection(py::module& m) ...@@ -147,12 +153,6 @@ void bind_cnn_face_detection(py::module& m)
"Find faces in an image using a deep learning model.\n\ "Find faces in an image using a deep learning model.\n\
- Upsamples the image upsample_num_times before running the face \n\ - Upsamples the image upsample_num_times before running the face \n\
detector." detector."
)
.def(
"__call__",
&cnn_face_detection_model_v1::detect_mult,
py::arg("imgs"), py::arg("upsample_num_times")=0, py::arg("batch_size")=128,
"takes a list of images as input returning a 2d list of mmod rectangles"
); );
} }
m.def("set_dnn_prefer_smallest_algorithms", &set_dnn_prefer_smallest_algorithms, "Tells cuDNN to use slower algorithms that use less RAM."); m.def("set_dnn_prefer_smallest_algorithms", &set_dnn_prefer_smallest_algorithms, "Tells cuDNN to use slower algorithms that use less RAM.");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment