Object Detection (YOLO, Overview)
Part of the AI Engineer Roadmap
In short
Classification says 'there's a dog'. Detection says 'dog here, bike there, person over there' with boxes around each. That's what powers traffic cameras, shelf scanners and self-checkout.
Locating and classifying multiple objects within an image with bounding boxes — YOLO's single-pass design made real-time detection practical.

Think of it like this
The traffic cop's single glance
A traffic cop at a busy junction doesn't study each vehicle one by one. One glance and he knows: car on the left, auto in the middle, a cow blocking lane two. YOLO, short for You Only Look Once, works the same way: one pass, every object at once.
Watch it happen
How YOLO turns one image into boxes
1/5A 640x640 street photo goes in. One forward pass, no sliding windows.
The big ideas
What you need to know
Box plus label plus score
Each detection is a rectangle, a class like 'car', and a confidence from 0 to 1.
One-stage vs two-stage
YOLO predicts everything in one pass, so it's fast. Older two-stage models like Faster R-CNN propose regions first, then classify.
IoU measures overlap
Intersection over Union compares two boxes. NMS uses it to drop duplicates, and evaluation uses it to judge hits.
mAP is the score
Mean Average Precision summarises precision and recall across classes and IoU thresholds. Higher is better.
See it in code
Walk through the code
1# pip install ultralytics2from ultralytics import YOLO3 4model = YOLO("yolov8n.pt") # small model pretrained on COCO5results = model("street.jpg", conf=0.25)6 7for box in results[0].boxes:8 cls_name = model.names[int(box.cls)]9 x1, y1, x2, y2 = box.xyxy[0].tolist()10 print(f"{cls_name} {float(box.conf):.2f} at {x1:.0f},{y1:.0f}")11 12results[0].save("street_boxes.jpg")1/3Load the nano model and run it with a 0.25 confidence threshold. NMS happens inside.
Ultralytics runs a pretrained YOLO in a few lines. COCO covers 80 everyday classes like person, car and dog.
Save yourself the pain
Common mistakes
Oops
Judging a detector by how many boxes it draws.
Do this instead
Measure precision and recall at a fixed IoU, or mAP. Many low-confidence boxes usually means many false alarms.
Oops
Expecting a COCO model to find classes it was never trained on, like auto-rickshaws or specific products.
Do this instead
Fine-tune on a few hundred labelled images of your own classes.
Your mission
Count vehicles in a photo
Quick check
Your detector draws three nearly identical boxes around one car. Which step is meant to fix this?
Go deeper
- 1Run a pretrained YOLO model on your own images or video.
- 2Learn the difference between classification, detection and segmentation tasks.
- 3Understand bounding box formats and non-max suppression at a conceptual level.
More topics at this stop
Stuck on this topic? Ask an Insider
Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.