Answers.Body: <p>Usually bounding-boxes are associated to a score or confidence. So, you loop over them considering the highest scoring first. You then set a <em>threshold</em> on the IoU (intersection over union) that is used to remove a bbox if the overlap is larger than the threshold. You repeat this until each bbox is tested.</p>
  <p>Indeed, it can happen that these are still more than the actual number of objects in the image. In fact, one disadvantage of NMS is that it is difficult to tune.</p>
  <p>Moreover, by changing the <em>minimum confidence</em> to accept a prediction (this is done before NMS) you can trade precision for the recall, and vice-versa. By varying this confidence you can build a precision-recall curve by considering all your test-set. If there are multiple classes you <em>average</em> on them to get the <em>mean average precision</em> (mAP).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-29T10:25:10.777Z
Answers.Text: @hachane If you find my answer helpful you may want to upvote and mark it as answered! :)
Answers.UserDisplayName: Luca Anzalone
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-30T12:51:39.230Z
Answers.Text: I am a new member here so I don't have enough reputation to give you an upvote :). Sorry and thank you again!!
Answers.UserDisplayName: hachane
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-05-02T16:34:06.533Z
Answers.Text: @hachane don't mind, I forgot that!
Answers.UserDisplayName: Luca Anzalone
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-28T13:26:11.667Z
Answers.LastActivityDate: 2024-04-28T13:26:11.667Z
Answers.UserDisplayName: Luca Anzalone
Body: <p>I am not really understanding the non-max supression (NMS) algorithm. Let's say my model produces 20 bounding boxes (bbs) for my picture which have 7 cats (7 objects with the same class). Can it be possible that after performing NMS on 20 bbs; the output can be 10 bbs?</p>
  <p>Also, I want to ask when I test the model with the test dataset, what does each point in the Precision Recall graph belong to? Does it belong to a picture or something?</p>
  <p>Thank you for reading my stupid questions : D.</p>
  
Tags: <computer-vision><object-recognition><bounding-box><object-tracking><non-max-suppression>
Title: Can the output of non-max suppression have more bounding boxes than the number of objects the picture actually has?
UserDisplayName: hachane
ThreadText: # Can the output of non-max suppression have more bounding boxes than the number of objects the picture actually has?
  
  (Asked by: username_0 on 2024-04-28)
  
  I am not really understanding the non-max supression (NMS) algorithm. Let's say my model produces 20 bounding boxes (bbs) for my picture which have 7 cats (7 objects with the same class). Can it be possible that after performing NMS on 20 bbs; the output can be 10 bbs?
  
  Also, I want to ask when I test the model with the test dataset, what does each point in the Precision Recall graph belong to? Does it belong to a picture or something?
  
  Thank you for reading my stupid questions : D.
  
  **Tags:** computer-vision, object-recognition, bounding-box, object-tracking, non-max-suppression
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-04-28. Score: 1
  
  Usually bounding-boxes are associated to a score or confidence. So, you loop over them considering the highest scoring first. You then set a *threshold* on the IoU (intersection over union) that is used to remove a bbox if the overlap is larger than the threshold. You repeat this until each bbox is tested.
  
  Indeed, it can happen that these are still more than the actual number of objects in the image. In fact, one disadvantage of NMS is that it is difficult to tune.
  
  Moreover, by changing the *minimum confidence* to accept a prediction (this is done before NMS) you can trade precision for the recall, and vice-versa. By varying this confidence you can build a precision-recall curve by considering all your test-set. If there are multiple classes you *average* on them to get the *mean average precision* (mAP).
  
  > **Comments:**
  > **username_1**: @username_0 If you find my answer helpful you may want to upvote and mark it as answered! :)  
  > **username_0**: I am a new member here so I don't have enough reputation to give you an upvote :). Sorry and thank you again!!  
  > **username_1**: @username_0 don't mind, I forgot that!  
  
  ---
  
  