▶ Sign up free for the video, slides & prompts
The lesson below is open to all. Enter your email once to unlock every video, slide deck, prompt and code example on this device.
Checking…
Computer Vision in Practice · Lesson 7 of 15 · 2 min read · 6 min video
Object detection
Boxes, classes and confidence: how models like YOLO find many objects at once.
📄 Download slides (PDF)· free sign-upClassification says "there's a bus in this picture". Object detection says "there are two buses, three bikes and an auto, and here is where each one is", with a box around every object.
What a detector outputs
For each object it finds:
- A bounding box: x, y, width and height
- A class: car, bus, person…
- A confidence score: how sure it is, from 0 to 1
How modern detectors work
A one-stage detector like YOLO (You Only Look Once) works in a single pass:
- A CNN backbone extracts features from the whole image
- The image is divided into a grid, and each cell predicts boxes, classes and confidences for objects centred there
- Non-maximum suppression (NMS) removes duplicate boxes for the same object, keeping the most confident one
Two-stage detectors, like Faster R-CNN, first propose regions and then classify each one. They're often more accurate but slower. Newer transformer detectors, like DETR and RT-DETR, skip NMS altogether.
Detection in a few lines
Training on your own classes
To detect things the pre-trained model doesn't know, such as auto-rickshaws, label your own images:
- Draw a box around every object in every image, with tools such as Label Studio, CVAT or Roboflow
- Export in the YOLO or COCO format
- Fine-tune the pre-trained detector on your data
Choosing a confidence threshold
- Low threshold: catches more objects, but more false alarms
- High threshold: fewer false alarms, but misses some objects
Choose it based on which mistake costs more in your app.
In one line
A detector finds every object in an image with a box, a class and a confidence score, and YOLO-style models do it in one fast pass, cleaned up with non-maximum suppression.
Share with a friend