Ultralytics YOLO27:
Computer Vision Foundations·Pick a Task·Lesson 2/10
Lessonbeginner

The Seven Vision Tasks

Map an output line to classification, detection, instance segmentation, semantic segmentation, depth estimation, pose, or OBB, and pick the YOLO26 weights to start with.

Choosing the task is the most expensive decision you make before training. Pick segmentation when boxes would do and your labeling bill multiplies; pick upright boxes for ships seen from a drone and every box is mostly water. Ultralytics YOLO supports seven tasks behind one API, so the choice is about the output you need — not the tooling.

Outcome

Name the one task and YOLO26 weights file that match your output line, and explain in one line why the next, more expensive task isn't needed.

Fast Track
If you already know your way around, here's the short version.
  1. One label for the whole image: classification.

  2. What and where, and a rectangle is enough: detection.

  3. Exact outline per object: instance segmentation. Class for every pixel: semantic segmentation.

  4. Distance for every pixel: depth estimation.

  5. Joints or landmarks: pose. Objects at angles from above: OBB.

  6. Same YOLO() API for all seven; only the weights file changes.

Hands-on

The seven tasks at a glance#

Seven Ultralytics YOLO task outputs: a classified leaf, detected cars and pedestrians, segmented cars, a semantic street map, a runner's pose skeleton, rotated boxes on ships, and a depth map

Read the table by the output column — that's what the output line of your spec must match.

TaskOutputAnswersYOLO26 weights
ClassificationOne label per image, with a probability"What is this image?"yolo26n-cls.pt
DetectionClass, box, and confidence per object"What is where?"yolo26n.pt
Instance segmentationClass and pixel mask per object"What exact shape is each object?"yolo26n-seg.pt
Semantic segmentationOne class for every pixel"What kind of region is each pixel?"yolo26n-sem.pt
Depth estimationDistance in meters for every pixel"How far away is each pixel?"yolo26n-depth.pt
Pose estimationBox and keypoints per person or object"How is the body posed?"yolo26n-pose.pt
Oriented bounding boxesRotated box per object"What is where, at what angle?"yolo26n-obb.pt

Two pairs trip people up. Instance vs semantic segmentation: instance separates every object (three cars, three masks); semantic labels pixels by class only (one "car" region, no count). Detection vs OBB: both return one box per object, but an OBB rotates with the object, which matters when objects lie at angles in top-down imagery.

One API, seven outputs#

Switching tasks doesn't mean switching tools. The weights file decides what comes back, and the Results object fills the matching attribute:

from ultralytics import YOLO

image = "https://ultralytics.com/images/bus.jpg"
outputs = ["probs", "boxes", "masks", "semantic_mask", "depth", "keypoints", "obb"]

for suffix in ["-cls", "", "-seg", "-sem", "-depth", "-pose", "-obb"]:
    weights = f"yolo26n{suffix}.pt"
    model = YOLO(weights)
    result = model(image, verbose=False)[0]
    filled = [name for name in outputs if getattr(result, name) is not None]
    print(f"{weights:18} task={model.task:9} -> {', '.join(filled)}")
yolo26n-cls.pt     task=classify  -> probs
yolo26n.pt         task=detect    -> boxes
yolo26n-seg.pt     task=segment   -> boxes, masks
yolo26n-sem.pt     task=semantic  -> semantic_mask
yolo26n-depth.pt   task=depth     -> depth
yolo26n-pose.pt    task=pose      -> boxes, keypoints
yolo26n-obb.pt     task=obb       -> obb

Read the right-hand column: segmentation and pose also return boxes, because they are detection plus one more thing. Semantic segmentation and depth return no per-object output at all — they describe every pixel instead. Your downstream code reads exactly one of these attributes, so the output line of your spec should name it.

Choosing in practice#

Start from what one prediction must describe, then take the cheapest task that answers the decision line:

  1. One label for the whole image → classification.
  2. A class for every pixel, with no need to separate objects → semantic segmentation.
  3. A distance for every pixel → depth estimation.
  4. Something about each object:
    • where it is, to count, locate, or filter it → detection (add tracking for identity across frames);
    • its exact shape, boundary, or area → instance segmentation;
    • its posture → pose;
    • its rotation in top-down imagery → OBB.

When two tasks both fit, choose the cheaper one to label and run. Detection is the default for most products: boxes are fast to draw and review, and with tracking on top they already power counting, zone alerts, and traffic analytics like this highway view:

Highway traffic tracked by Ultralytics YOLO, with a persistent ID and motion trail on every car, bus, and truck

Depth: the task that answers "how far"#

Depth estimation returns a map the size of the image with one distance, in meters, per pixel — no classes and no boxes. Use it when distance drives the decision: a robot keeping clear of obstacles, a vehicle slowing when something is close, a rough volume estimate of a pile.

from ultralytics import YOLO

model = YOLO("yolo26n-depth.pt")
result = model("https://ultralytics.com/images/bus.jpg", verbose=False)[0]

depth = result.depth.data  # meters, one value per pixel
print(f"depth map {tuple(depth.shape)}, nearest {float(depth.min()):.1f} m, farthest {float(depth.max()):.1f} m")
depth map (1080, 810), nearest 2.0 m, farthest 14.9 m

A single camera infers depth from learned cues such as perspective and object size, so measure its error on your own scenes before using it for safety-critical distances. Depth pairs well with detection: detect the object, then read the depth map inside its box.

Pitfalls#

Mix-upSymptomBetter choice
Segmentation where boxes would doNo downstream code ever reads the maskDetection
Upright boxes on top-down imageryBoxes are mostly background, and neighbors suppress each otherOBB
Classification for a multi-object sceneThe label depends on one small objectDetection plus a rule
Semantic segmentation when you need countsTouching objects merge into one regionInstance segmentation
Box size as a distance proxyRules break when object sizes varyDepth estimation, or detection plus depth
Pose to check presenceYou never read a keypointDetection
Don't pay for outputs you won't use

Richer outputs cost more at every stage: masks and keypoints take longer to draw, longer to review, and need stricter labeling rules. Start with the cheapest task that answers the decision line, and upgrade only when a real consumer needs the extra detail.

Try It

Take the output line from your spec in lesson 1 and walk the ladder above. Write down the task, the YOLO26 weights file you'd start with, the Results attribute your code will read, and one line on why the next, more expensive task isn't needed. No project yet? Use the forklift spec.

Done When
You've finished the lesson when all of these are true.
  • You have named one task, its YOLO26 weights file, and the Results attribute your code reads.

  • You have one written line explaining why the next, more expensive task isn't needed.

  • You can say whether your project needs instance or semantic segmentation, depth, or none of them — and why.

Show solution

For the forklift spec, the answer is detection with yolo26n.pt, read from result.boxes.

The decision line needs to know where forklifts and people are so code can test how close they are. Boxes answer that. Instance segmentation would add labeling cost without changing the alert, because a box's bottom edge already gives the ground position. Pose isn't needed because posture isn't part of the decision. Depth could help turn image positions into meters, but a calibrated fixed camera maps the floor plane without it. OBB is only worth testing if the cameras look straight down and forklifts appear at steep diagonal angles.

What's next

Next, a closer look at detection — the workhorse task, and the one most products start with.