...

/

Understanding NMS (Non-Maximum Suppression)

Understanding NMS (Non-Maximum Suppression)

Learn how NMS, a post processing logic, is used to eliminate redundant boxes

Why do we need NMS?

Object detection models often predict multiple bounding boxes for a single object in an image. However, the final output should ideally have only one bounding box per object. To achieve this, a technique called non-maximum suppression (NMS) is used.

In the image below, there are three bounding boxes predicted for one person with different confidence scores. On visual inspection, for our final output, we would prefer the green box because it fits better as compared to the other two boxes and has the highest confidence score.

Press + to interact
Multiple bounding boxes predicted for a single object
Multiple bounding boxes predicted for a single object

How does NMS work?

NMS works at the inference stageWhile making predictions as a post processing step to suppress unnecessary boxes and to output a confident box.
The format of a bounding box followed in YOLO is [xmin,ymin,xmax,ymax,conf,classx_{min}, y_{min}, x_{max}, y_{max}, conf, class ...

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy