Per-pixel, not per-box
Detection drew a box around each object. Segmentation goes finer: it assigns a class to every pixel, so the output is a label map the same height and width as the input. That's what you need when the shape matters — a tumor's exact boundary, the drivable area in front of a car, the matte that separates a subject from its background.
Two flavors that solve different problems
- Semantic segmentation (e.g. DeepLabV3Plus, SegFormer) — labels every pixel with a class. DeepLab leans on atrous (dilated) convolution to see multiple scales at once without losing resolution; SegFormer is the transformer-era counterpart. Reach for these when you have a fixed set of classes you care about.
- Salient / boundary-aware (e.g. BASNet) — separates foreground from background cleanly, optimizing for crisp edges rather than class identity. This is the matting / cut-out use case.
All of them load through the same from_preset door, ride pretrained backbones, and run on any backend. The output convention is the thing to internalize: a class map you can argmax over the channel axis to get a single label per pixel.