diff --git a/tools/python/src/object_detection.cpp b/tools/python/src/object_detection.cpp index 0b8d7294c..09a785c0c 100644 --- a/tools/python/src/object_detection.cpp +++ b/tools/python/src/object_detection.cpp @@ -342,7 +342,7 @@ ensures \n\ "Loads an object detector from a file that contains the output of the \n\ train_simple_object_detector() routine or a serialized C++ object of type\n\ object_detector>>.") - .def("__call__", run_detector_with_upscale, (arg("image"), arg("upsample_num_times")=0), + .def("__call__", run_detector_with_upscale2, (arg("image"), arg("upsample_num_times")=0), "requires \n\ - image is a numpy ndarray containing either an 8bit grayscale or RGB \n\ image. \n\ diff --git a/tools/python/src/simple_object_detector_py.h b/tools/python/src/simple_object_detector_py.h index 556784e4a..1870789a3 100644 --- a/tools/python/src/simple_object_detector_py.h +++ b/tools/python/src/simple_object_detector_py.h @@ -32,7 +32,8 @@ namespace dlib } } - inline std::vector run_detector_with_upscale ( + + inline std::vector run_detector_with_upscale1 ( dlib::simple_object_detector& detector, boost::python::object img, const unsigned int upsampling_amount, @@ -111,10 +112,23 @@ namespace dlib } } + inline std::vector run_detector_with_upscale2 ( + dlib::simple_object_detector& detector, + boost::python::object img, + const unsigned int upsampling_amount + ) + { + std::vector detection_confidences; + std::vector weight_indices; + + return run_detector_with_upscale1(detector, img, upsampling_amount, + detection_confidences, weight_indices); + } + inline boost::python::tuple run_rect_detector ( - dlib::simple_object_detector& detector, - boost::python::object img, - const unsigned int upsampling_amount) + dlib::simple_object_detector& detector, + boost::python::object img, + const unsigned int upsampling_amount) { boost::python::tuple t; @@ -122,8 +136,8 @@ namespace dlib std::vector weight_indices; std::vector rectangles; - rectangles = run_detector_with_upscale(detector, img, upsampling_amount, - detection_confidences, weight_indices); + rectangles = run_detector_with_upscale1(detector, img, upsampling_amount, + detection_confidences, weight_indices); return boost::python::make_tuple(rectangles, detection_confidences, weight_indices); @@ -144,7 +158,7 @@ namespace dlib std::vector detection_confidences; std::vector weight_indices; - return run_detector_with_upscale(detector, img, upsampling_amount_, + return run_detector_with_upscale1(detector, img, upsampling_amount_, detection_confidences, weight_indices); } @@ -152,7 +166,8 @@ namespace dlib { std::vector detection_confidences; std::vector weight_indices; - return run_detector_with_upscale(detector, img, upsampling_amount, + + return run_detector_with_upscale1(detector, img, upsampling_amount, detection_confidences, weight_indices); }