Skip to content

Commit

Permalink
Fix nms thresh
Browse files Browse the repository at this point in the history
Signed-off-by: Micaela Verucchi <micaelaverucchi@gmail.com>
  • Loading branch information
mive93 committed Feb 15, 2022
1 parent 04de990 commit 3bcc32f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Yolo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ void Yolo::mergeDetections(Yolo::detection *dets, int ndets, int classes, double
}
total = k+1;

float thresh = 0.45f;
for(k = 0; k < classes; ++k){
for(i = 0; i < total; ++i){
dets[i].sort_class = k;
Expand All @@ -288,9 +289,9 @@ void Yolo::mergeDetections(Yolo::detection *dets, int ndets, int classes, double
box a = dets[i].bbox;
for(j = i+1; j < total; ++j){
box b = dets[j].bbox;
if (nsm_kind == GREEDY_NMS && yolo_box_iou(a, b) > nms_thresh)
if (nsm_kind == GREEDY_NMS && yolo_box_iou(a, b) > thresh)
dets[j].prob[k] = 0;
else if (nsm_kind == DIOU_NMS && yolo_box_diou(a, b, nms_thresh) > nms_thresh)
else if (nsm_kind == DIOU_NMS && yolo_box_diou(a, b, nms_thresh) > thresh)
dets[j].prob[k] = 0;
}
}
Expand Down

0 comments on commit 3bcc32f

Please sign in to comment.