diff --git a/src/Yolo.cpp b/src/Yolo.cpp index deffbeb..db14774 100644 --- a/src/Yolo.cpp +++ b/src/Yolo.cpp @@ -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; @@ -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; } }