The object detection algorithms produce many bounding boxes for the same object to be detected. Ideally, we would want a single bounding box for each object in the image. Hence, at first, we select the bounding box with the highest confidence score. Then, we calculate the IoU of all the remaining bounding boxes with this box with the highest score. If the IoU is greater than the threshold we eliminate the bounding box.