---
title: Text-Prompt Segmentation
description: Turn a text phrase into segmentation masks across a dataset with SAM3 open-vocabulary prompts. Zero-shot, batch-capable, callable from the Pictograph SDK.
section: Workflows
order: 6
---
A text phrase becomes masks. With SAM3 you describe what you want in words, such as "delivery truck" or "cracked pavement", and Pictograph segments every match. It is zero-shot, so you do not train a model first, and it works on one image or a whole dataset.

```python
from pictograph import Client

client = Client()

result = client.auto_annotate.text(
    dataset_name="Street Scenes",
    image_filename="frame-0001.jpg",
    text="delivery truck",
    name="truck",
)
print(len(result.annotations), "masks")
```

## How do I segment images from a text prompt?

Pass the concept as the `text` argument and the class name to store it under. SAM3 grounds the phrase against the image and returns polygons for every instance it finds, ranked by confidence. Save them like any other annotation.

## How do I run it across a dataset?

Batch text prompts label many images and many concepts in one async job:

```python
job = client.batch.auto_annotate(
    dataset_name="Street Scenes",
    classes=["delivery truck", "pedestrian", "traffic cone"],
)
job = client.batch.wait(job.id)
```

Each class is grounded independently per image, and overlapping detections are de-duplicated, so you get clean per-class masks across the set.

## When should I use zero-shot text prompts?

- **Cold-start a dataset.** Label common objects before you have any trained model.
- **Rare or long-tail classes.** Describe a concept once instead of hand-labeling hundreds of examples.
- **Exploration.** Try a class name, review the masks, and keep what works.

For pixel-precise single instances, point and box prompts give you finer control. See the [SAM3 auto-annotation guide](/docs/sam3-auto-annotation.md).

## Next steps

- [SAM3 auto-annotation](/docs/sam3-auto-annotation.md)
- [Auto-annotation overview](/auto-annotate)

_Last updated June 2026._