Skip to content

    Object Detection (YOLO)

    AI · Advanced

    Definition

    Object detection finds and labels objects with bounding boxes in images.

    Powers self-driving cars, CCTV analytics and proctoring.

    Diagram

    image→ boxes→ NMS→ labels

    Flowchart

    Input imagePredict boxes + classesFilter by confidenceNon-max suppressionOutput detections

    Example: IoU of two boxes

    a, b = (0, 0, 2, 2), (1, 1, 3, 3)
    iw = max(0, min(a[2], b[2]) - max(a[0], b[0]))
    ih = max(0, min(a[3], b[3]) - max(a[1], b[1]))
    inter = iw * ih
    print(round(inter / (4 + 4 - inter), 3))

    Output: 0.143

    Key points

    • IoU measures box overlap
    • mAP evaluates detectors

    Interview questions

    What is non-max suppression?

    It removes overlapping boxes, keeping the highest-confidence one.

    More AI topics