Commit 84b72278 authored by davemers0160's avatar davemers0160 Committed by Davis E. King

fixed check for excessive detections in loss_mmod_ (#1625)

fixed check for excessive detections in loss_mmod_

Ran into the problem where dets.size() was equal to max_num_initial_dets which then throws a subscript out of range error when accesing: dets[max_num_initial_dets].detection_confidence.  This fixes that issue.
parent ea451995
......@@ -1135,7 +1135,7 @@ namespace dlib
// Prevent calls to tensor_to_dets() from running for a really long time
// due to the production of an obscene number of detections.
const unsigned long max_num_initial_dets = max_num_dets*100;
if (dets.size() >= max_num_initial_dets)
if (dets.size() > max_num_initial_dets)
{
det_thresh_speed_adjust = std::max(det_thresh_speed_adjust,dets[max_num_initial_dets].detection_confidence + options.loss_per_false_alarm);
}
......
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