Made the index outputs of run_multiple_rect_detectors be integers rather than doubles.

This commit is contained in:
Davis King 2018-02-10 17:12:13 -05:00
parent 1ec5a94554
commit 5bde5c526e
1 changed files with 11 additions and 9 deletions

View File

@ -18,7 +18,7 @@ namespace dlib
std::vector<rect_detection>& rect_detections,
std::vector<rectangle>& rectangles,
std::vector<double>& detection_confidences,
std::vector<double>& weight_indices
std::vector<unsigned long>& weight_indices
)
{
rectangles.clear();
@ -40,7 +40,7 @@ namespace dlib
const unsigned int upsampling_amount,
const double adjust_threshold,
std::vector<double>& detection_confidences,
std::vector<double>& weight_indices
std::vector<unsigned long>& weight_indices
)
{
pyramid_down<2> pyr;
@ -120,7 +120,7 @@ namespace dlib
const unsigned int upsampling_amount,
const double adjust_threshold,
std::vector<double>& detection_confidences,
std::vector<double>& weight_indices
std::vector<unsigned long>& weight_indices
)
{
pyramid_down<2> pyr;
@ -202,7 +202,7 @@ namespace dlib
)
{
std::vector<double> detection_confidences;
std::vector<double> weight_indices;
std::vector<unsigned long> weight_indices;
const double adjust_threshold = 0.0;
return run_detector_with_upscale1(detector, img, upsampling_amount,
@ -219,7 +219,7 @@ namespace dlib
py::tuple t;
std::vector<double> detection_confidences;
std::vector<double> weight_indices;
std::vector<unsigned long> weight_indices;
std::vector<rectangle> rectangles;
rectangles = run_detector_with_upscale1(detector, img, upsampling_amount,
@ -227,7 +227,8 @@ namespace dlib
detection_confidences, weight_indices);
return py::make_tuple(rectangles,
detection_confidences, weight_indices);
vector_to_python_list(detection_confidences),
vector_to_python_list(weight_indices));
}
inline py::tuple run_multiple_rect_detectors (
@ -243,11 +244,11 @@ namespace dlib
// Now copy the data into dlib based objects.
for (unsigned long i = 0; i < num_detectors; ++i)
{
vector_detectors.push_back(detectors[i].cast<simple_object_detector >());
vector_detectors.push_back(detectors[i].cast<simple_object_detector >());
}
std::vector<double> detection_confidences;
std::vector<double> weight_indices;
std::vector<unsigned long> weight_indices;
std::vector<rectangle> rectangles;
rectangles = run_detectors_with_upscale1(vector_detectors, img, upsampling_amount,
@ -255,7 +256,8 @@ namespace dlib
detection_confidences, weight_indices);
return py::make_tuple(rectangles,
detection_confidences, weight_indices);
vector_to_python_list(detection_confidences),
vector_to_python_list(weight_indices));
}