Skip to content

Commit

Permalink
FIX: add clamp for iou_score
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuentau committed Dec 23, 2020
1 parent 67489d6 commit 2f4001b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/facedetectcnn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,15 @@ bool detection_output(const CDataBlob<float> * priorbox,
float cls_score = pConf[i + 1];
int face_idx = i / 2;
float iou_score = pIoU[face_idx];
// clamp
if (iou_score < 0.f) {
iou_score = 0.f;
}
else if (iou_score > 1.f) {
iou_score = 1.f;
}
float conf = sqrtf(cls_score * iou_score);

if(conf > confidence_threshold)
{
float fBox_x1 = pPriorBox[face_idx * 4];
Expand Down

0 comments on commit 2f4001b

Please sign in to comment.