Commit c9b050e2 authored by Davis King's avatar Davis King

Fixed bug in evaluate_detectors() and added unit tests.

parent e3af40d5
...@@ -1285,7 +1285,7 @@ namespace dlib ...@@ -1285,7 +1285,7 @@ namespace dlib
const double thresh = detectors[i].get_processed_w(d).w(scanner.get_num_dimensions()); const double thresh = detectors[i].get_processed_w(d).w(scanner.get_num_dimensions());
impl::detect_from_fhog_pyramid<pyramid_type>(feats, scanner.get_feature_extractor(), impl::detect_from_fhog_pyramid<pyramid_type>(feats, scanner.get_feature_extractor(),
detectors[i].get_processed_w(d).get_detect_argument(), thresh, detectors[i].get_processed_w(d).get_detect_argument(), thresh+adjust_threshold,
det_box_height, det_box_width, cell_size, max_filter_height, det_box_height, det_box_width, cell_size, max_filter_height,
max_filter_width, temp_dets); max_filter_width, temp_dets);
......
...@@ -404,6 +404,22 @@ namespace ...@@ -404,6 +404,22 @@ namespace
validate_some_object_detector_stuff(images, detector, 1e-6); validate_some_object_detector_stuff(images, detector, 1e-6);
} }
{
std::vector<object_detector<image_scanner_type> > detectors;
detectors.push_back(detector);
detectors.push_back(detector);
detectors.push_back(detector);
std::vector<rectangle> dets1 = evaluate_detectors(detectors, images[0]);
std::vector<rectangle> dets2 = detector(images[0]);
DLIB_TEST(dets1.size() > 0);
DLIB_TEST(dets2.size() == dets1.size());
for (unsigned long i = 0; i < dets1.size(); ++i)
{
DLIB_TEST(dets1[i] == dets2[i]);
}
}
} }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
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