FAQ

Computer vision

Instance segmentation: what the data has to contain

Per-object masks rather than per-class, why crowd regions are encoded differently, and the cheaper routes to getting masks at all.

Instance segmentation needs a mask per object rather than a class per pixel. The big general-purpose sets exist — COCO, LVIS, and Open Images with masks for 2.8 million objects — but outside them purpose-built open sets for specific domains are scarce, which makes the routes to producing your own the more useful subject.

An honest note on availability

We built this site's dataset posts on a verified set of 434 open datasets, and when we searched it for sets whose own documentation describes them as supporting instance segmentation specifically, the answer was COCO alone. Plenty support segmentation; no other says instance segmentation.

Rather than pad a list by including semantic segmentation sets and letting you discover the mismatch after downloading, this post covers what the data must contain and how to obtain it. Our semantic segmentation datasets post covers the semantic sets, which are abundant — just not interchangeable with these.

That scarcity is itself informative: per-object masks are among the most expensive annotations in computer vision, which is why fewer datasets carry them and why the generation routes below matter so much.

Semantic masks cannot be split back into instances — the boundaries between objects were never recorded. Check which one your task needs before picking data.

The distinction, precisely

Semantic segmentation assigns a class to every pixel: all cars are “car”, as one undifferentiated region. Instance segmentation assigns a separate mask to each object: this car, that car, the third car.

You need instances if your application counts objects, tracks them between frames, measures individual objects, or must handle two overlapping items of the same class. You need semantic labels if you care about area and extent — land cover, road surface, tumour region.

The data is not convertible in the direction you want. Instance masks can be merged down into semantic masks trivially. Semantic masks cannot be split into instances, because the information about where one object ends and the next begins was never recorded. A semantic dataset cannot train an instance model, whatever its size.

How the format encodes it

In COCO-format data, instance masks live in the segmentation field, and that field is polymorphic in a way that catches people — it depends on the iscrowd flag.

With iscrowd: 0, segmentation is a list of polygons, each a flat list of alternating coordinates. An object split by occlusion gets several polygons in that outer list, which is how the format represents a partially hidden object as one instance.

With iscrowd: 1, the object is a crowd region — a pile of bicycles, a stadium of people — and segmentation becomes a run-length encoding object instead, which needs a library to decode. Crowd regions are ignored in the standard evaluation: a detection that lands on one counts neither as a hit nor as a false positive.

If your loader handles polygons and not run-length encodings, part of your dataset will appear empty. Our COCO format post covers both shapes and the area field, which is computed from the mask rather than the box and determines your per-size metric breakdown.

Four photographs (an emu, a woman with a backpack, an arm holding a bottle, a Zurich sign), each shown three times with the same single green point prompt and a different outlined mask: the whole object, a part, and a smaller sub-part.
One point, three valid masks: from a single click SAM returns the whole object, a part or a sub-part, and a box narrows down which you meant — which is why cheap box annotation plus a model is usually better than annotating masks. Image: facebookresearch/segment-anything · Apache-2.0 repository

The cheap route: generate the masks

Because mask annotation is so expensive, the most productive approach for most teams is not to annotate masks at all.

Box plots of annotation time in seconds per mask (0 to 20) for polygon, SAM 1 and SAM 2, split by first and second image. The polygon box spans about 7 to 10 seconds with outliers up to 19; the SAM boxes sit between about 1 and 4 seconds.
Annotation time per mask in a user study on agricultural images: drawing polygons by hand against prompting SAM 1 or SAM 2, for the first and second image each annotator worked on. Polygons took a median of about 9 seconds per mask; the SAM-based tools between about 1.3 and 3.2. That is the economics of generating masks, with a person still reviewing the output. Image: Figure 6 of the article · CC BY 4.0 · from Oehme et al. 2026, Frontiers in Artificial Intelligence, “Orchestrating segment anything models to accelerate segmentation annotation on agricultural image datasets”, doi:10.3389/frai.2025.1748468

Promptable segmentation models will produce a high-quality mask for an object given a box or a click. So: annotate bounding boxes, which is perhaps five to ten times faster than masks; feed each box to a promptable model; get precise masks out; review a sample. You have an instance segmentation dataset for roughly the cost of a detection dataset.

Those masks can then train a smaller, faster model you can afford to deploy, or be used directly. Our segmentation fine-tuning post covers the approach and its limits — chiefly that it degrades on imagery unlike natural photographs, such as medical scans, microscopy or infrared, and on domains where the boundary is a matter of convention rather than visible edge.

The other route, where your objects are rigid and well-defined, is rendering: synthetic scenes give you perfect instance masks for free. The transfer gap is real but domain randomisation narrows it, and for industrial parts on a conveyor it is often entirely adequate.

A photo of five brown bears on a lakeshore, overlaid with coloured masks and green boxes labelled bear (scores 0.32 to 0.47), lake (0.59) and shore (0.49), under a generated caption: 'There are five bears sitting on the shore of a lake.'
The generation route run end to end: a caption model describes the image, its nouns prompt an open-vocabulary detector, and SAM turns each box into a mask. None of the scores reaches 0.6, which is why the route ends with a person reviewing a sample rather than with the output. Image: IDEA-Research/Grounded-Segment-Anything · Apache-2.0 repository · from “Grounded SAM: Assembling Open-World Models for Diverse Visual Tasks”, arXiv:2401.14159

What to check in any mask data you acquire

Whether from annotation, generation or a public source, the same defects recur.

Boundary precision. Look at masks at full resolution, not thumbnails. Polygons with a handful of vertices teach the model to produce coarse approximations, and that ceiling cannot be lifted later.

Occlusion handling. Is a partially hidden object one instance with multiple polygons, or two instances? Both conventions exist and mixing them within one dataset teaches inconsistency.

Completeness. As in detection, an unannotated object is taught as background. This is the most damaging defect available and is invisible in summary statistics.

The area field. If it was populated from bounding boxes rather than masks, your small/medium/large metric breakdown is skewed and not comparable to published results.

Questions people ask

Can I use a semantic segmentation dataset for instance segmentation?

No. The instance boundaries were never recorded, so there is nothing to recover. You can go the other way — merge instance masks by class to get semantic masks — but not this direction, regardless of dataset size.

How many masks do I need?

Starting from pretrained weights, hundreds of instances per class is a reasonable target, with coverage of your real conditions mattering more than count. If you are fine-tuning a promptable model's boundary behaviour rather than training from scratch, fewer still.

Is box-to-mask generation good enough for production?

Frequently yes for natural imagery, and it is now a standard pipeline. Review a sample rather than trusting it blindly, and be more cautious for unusual modalities or where the boundary is a domain judgement — those are the cases where a general model gives you a plausible boundary that is not your field's.

What if no dataset and no generation route fits?

Then the data has to be made. For a well-specified task a few thousand reviewed masks is a tractable commission, and it is the one route that gives you data matching your actual conditions. You can order custom annotation if building the capability in-house is not worth it.

Stop hunting. Start searching.

Tens of thousands of curated datasets, searchable in plain language — with the licence and size checked before you download anything.

Search Dataset Finder →