AI in Motion

Computer VisionIntermediate1:37 video6 chapters

Object Detection: Boxes, IoU and NMS — lecture notes

Find every object and draw a box around it. From sliding windows to YOLO-style grids, IoU and non-maximum suppression.

▶ Watch the animated lecture

0:001. Introduction

Introduction — Object Detection: Boxes, IoU and NMS

Classification says what is in an image. Object detection says what and where: it draws a labelled box around every object.

0:092. Sliding windows

Sliding windows — Object Detection: Boxes, IoU and NMS

The classic approach slides a window across the image and asks a classifier: is there a car here? The score rises when the window covers a car. But a real image needs thousands of windows at many sizes, which is very slow.

0:273. Modern detectors

Modern detectors — Object Detection: Boxes, IoU and NMS

Modern detectors like YOLO look once. The image is divided into a grid, and every cell predicts boxes and confidence scores for objects centred in it, all in a single pass. That produces many overlapping candidate boxes. Non-maximum suppression keeps the best box for each object and removes the duplicates.

0:494. IoU

IoU — Object Detection: Boxes, IoU and NMS

How do we measure whether a predicted box is right? Intersection over union: the overlap area divided by the combined area. Zero means no overlap, one means a perfect match. As the prediction slides into place, IoU rises to 0.6, and a common rule counts 0.5 or more as a correct detection.

1:115. Detector families

Detector families — Object Detection: Boxes, IoU and NMS

Two-stage detectors, like Faster R-CNN, first propose regions and then classify them: accurate but slower. One-stage detectors, like YOLO and SSD, predict everything in one pass, fast enough for real-time video.

1:246. Recap

Recap — Object Detection: Boxes, IoU and NMS

To recap. Detection gives a class and a box for every object. Modern detectors predict many boxes at once. IoU measures overlap, and non-maximum suppression removes duplicates.

Key takeaways

  • Object detection predicts a class and a bounding box for each object.
  • IoU = overlap area ÷ union area; 0.5 is a common threshold for a correct box.
  • Non-maximum suppression keeps the highest-scoring box and removes overlapping duplicates.
  • One-stage detectors (YOLO, SSD) are fast; two-stage detectors (Faster R-CNN) are very accurate.

Check yourself

  1. What does IoU measure?
    Show answer

    How much two boxes overlap — Intersection over union compares overlap to total area.

  2. What is non-maximum suppression for?
    Show answer

    Removing duplicate overlapping boxes — It keeps the best box and suppresses its overlapping neighbours.

  3. Why were sliding windows slow?
    Show answer

    They classify thousands of windows at many sizes — Exhaustive scanning is expensive.

Go deeper

© 2026 Janin A Apurba, CSE, AUST · Advanced ICT Officer, CNRS-UNHCR. All rights reserved. Notes for the animated lecture at https://ai-in-motion.vercel.app/watch/object-detection.html