Commit f2426231 authored by Davis King's avatar Davis King

Changed the object_detector interface slightly. In particular, it now handles

the adjust_threshold argument slightly differently in that it does not add it
to the output detection score anymore.
parent 238effb9
...@@ -293,10 +293,10 @@ namespace dlib ...@@ -293,10 +293,10 @@ namespace dlib
if (w.size() != 0) if (w.size() != 0)
{ {
std::vector<std::pair<double, rectangle> > dets; std::vector<std::pair<double, rectangle> > dets;
const double thresh = w(scanner.get_num_dimensions()) + adjust_threshold; const double thresh = w(scanner.get_num_dimensions());
scanner.load(img); scanner.load(img);
scanner.detect(w, dets, thresh); scanner.detect(w, dets, thresh + adjust_threshold);
for (unsigned long i = 0; i < dets.size(); ++i) for (unsigned long i = 0; i < dets.size(); ++i)
{ {
......
...@@ -153,15 +153,19 @@ namespace dlib ...@@ -153,15 +153,19 @@ namespace dlib
- #dets.size() == the number of detected objects. - #dets.size() == the number of detected objects.
- #dets[i].first gives the "detection confidence", of the i-th - #dets[i].first gives the "detection confidence", of the i-th
detection. This is the detection value output by the scanner detection. This is the detection value output by the scanner
minus the threshold, therefore this is a value > 0. minus the threshold.
- #dets[i].second == the bounding box for the i-th detection. - #dets[i].second == the bounding box for the i-th detection.
- #get_scanner() will have been loaded with img. Therefore, you can call - #get_scanner() will have been loaded with img. Therefore, you can call
#get_scanner().get_feature_vector() to obtain the feature vectors or #get_scanner().get_feature_vector() to obtain the feature vectors or
#get_scanner().get_full_object_detection() to get the #get_scanner().get_full_object_detection() to get the
full_object_detections for the resulting object detection boxes. full_object_detections for the resulting object detection boxes.
- The detection threshold is adjusted by having adjust_threshold added - The detection threshold is adjusted by having adjust_threshold added to
to it. Therefore, an adjust_threshold value > 0 makes detecting it. Therefore, an adjust_threshold value > 0 makes detecting objects
objects harder while a negative one makes it easier. harder while a negative one makes it easier. Moreover, the following
will be true for all valid i:
- #dets[i].first >= adjust_threshold
This means that, for example, you can obtain all possible detections as
outputs by setting adjust_threshold equal to negative infinity.
!*/ !*/
template < template <
......
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