mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
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.
This commit is contained in:
parent
ea45199572
commit
84b72278b5
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user