Correct
I think I last watched the video 5 years ago, so I really can’t say. But the question recurs periodically so I suppose this is correct also
The YOLO algorithm produces thousands of predictions each forward pass. It is possible that some of the predicted bounding boxes overlap. NMS with IOU is one way to try to remove false positives, that is two separate predictions that are actually the same object in the image.
Suppose two bounding box predictions are identical in both location and shape, meaning they occupy exactly the same pixels in the image. This could happen if the center of an object is near a grid cell boundary and two distinct detectors (grid cell + anchor box) each think they are responsible for making the prediction.in this thought experiment there is only one object in the image, but two predicted bounding boxes, and their IOU == 1.0
In this case you only want one prediction to survive for downstream processing, and you can achieve this by keeping only the highest confidence prediction regardless of what the respective class predictions are.
At the other end of the scale, suppose there are two objects in the image and the IOU of their predicted bounding boxes is very low. In this case you want NMS to keep both predictions. Again, you can make this decision based only on predicted bounding box location and shape and regardless of their class predictions.
The problem that I see with running NMS separately for all classes is that afterwards you can still have two predictions in exactly the same location and exactly the same shape, but now no way to rule one out.
A point I have tried to make in this and other related threads is that this stuff is engineering applied to achieve specific business outcomes.There isn’t one rule that you can just always apply that is always right. Use the technology that fits the operational situation and needed results. For the YOLO inventors, non-class NMS addressed their needs. I have never experienced a suitably trained YOLO model that got better performance running NMS per class. Your mileage may vary.