> For the complete documentation index, see [llms.txt](https://docs.eyepop.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eyepop.ai/platform/abilities/open-vocabulary.md). Agents can also search and read this documentation through its [MCP server](https://docs.eyepop.ai/~gitbook/mcp).

# Open vocabulary

Pretrained models that find, segment and classify what you describe in words

An open-vocabulary model takes its labels **per request**. Instead of choosing from a label set fixed at training, you tell the component what to look for in words, and it reports what it finds under the labels you choose. The same ability finds forklifts in one Pop and shopping carts in the next, and you can change the question for every image without redefining the Pop.

Every open-vocabulary ability takes the same parameter, `prompts`, so switching from one to another changes the ability name and nothing else.

| Page                                                                                                                  | Abilities                                                                                      |
| --------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| [Classify the whole image](https://docs.eyepop.ai/platform/abilities/open-vocabulary/classify-the-whole-image.md)     | `eyepop.clipv2.classify`, `eyepop.siglip2.classify`                                            |
| [Classify a detected object](https://docs.eyepop.ai/platform/abilities/open-vocabulary/classify-a-detected-object.md) | A detector, then `eyepop.clipv2.classify` or `eyepop.siglip2.classify` on each crop            |
| [Classify an event](https://docs.eyepop.ai/platform/abilities/open-vocabulary/classify-an-event.md)                   | `eyepop.qwen3.event-classify`, on video                                                        |
| [Detect and segment](https://docs.eyepop.ai/platform/abilities/open-vocabulary/detect-and-segment.md)                 | `eyepop.sam3.detect`, `.segment`, `.contour`, `eyepop.grounding-dino.detect`                   |
| [Promptable VLM tasks](https://docs.eyepop.ai/platform/abilities/open-vocabulary/promptable-vlm-tasks.md)             | `eyepop.qwen3`, `eyepop.gemini-4-argon`, `eyepop.gpt-6-astra`, each as `classify` and `detect` |
| [Recipes](https://docs.eyepop.ai/platform/abilities/open-vocabulary/recipes.md)                                       | A different question per image, asking a VLM about each crop                                   |

### Prompts

`prompts` is a list of `{prompt, label}` pairs in the component's `params`:

```json
{
    "type": "inference",
    "ability": "eyepop.sam3.detect:latest",
    "params": {
        "prompts": [
            { "prompt": "forklift" },
            { "prompt": "hand pallet truck", "label": "pallet jack" }
        ]
    }
}
```

| Key      | Type   | Meaning                                                                      |
| -------- | ------ | ---------------------------------------------------------------------------- |
| `prompt` | string | The text the model matches against the image. Required.                      |
| `label`  | string | The class label a match is reported under. Optional; defaults to the prompt. |

The prompt is written for the model, the label for your code. Keep the two apart when a model matches a descriptive phrase best but your application wants a short, stable name: `"a photo of a bus"` reported as `bus`. Several prompts may share one label on the detectors, which is how a set of synonyms becomes one class — see [Prompt versus label](#prompt-versus-label).

#### Where to set them

* **In the Pop**, as the component's `params`. Every source the session processes is asked the same question.
* **Per source**, with [component parameters](https://docs.eyepop.ai/platform/sources-and-options/options/component-parameters.md). Give the component an `id`, then pass `{"prompts": [...]}` for that id when you submit an image or a video. The values apply to that source only; the next source falls back to the Pop's own `params`. See [A different question for every image](https://docs.eyepop.ai/platform/abilities/open-vocabulary/recipes.md#a-different-question-for-every-image).

A component with no prompts from either place has nothing to look for: the request is rejected with an error naming the ability and its prompt limit.

#### Instructions

The VLM abilities (`eyepop.qwen3.*`, `eyepop.gemini-4-argon.*`, `eyepop.gpt-6-astra.*`) also take `instructions` in their `params`: your own instructions for the task, up to 2000 characters, such as `"The camera captures an entire ferry terminal. Focus on the main booth area and ignore adjacent roads and traffic."` The prompts say what to look for; the instructions say how to look. They are added to the model's own instructions, so they cannot change the shape of the answer. Set them in the Pop or per source, like the prompts.

#### Limits

| Ability                                                             | Prompts per request | Several prompts may share a label |
| ------------------------------------------------------------------- | ------------------- | --------------------------------- |
| `eyepop.sam3.detect`, `.segment`, `.contour`                        | 1 to 8              | yes                               |
| `eyepop.grounding-dino.detect`                                      | 1 to 8              | yes                               |
| `eyepop.clipv2.classify`, `eyepop.siglip2.classify`                 | 1 to 128            | yes                               |
| `eyepop.gemini-4-argon.*`, `eyepop.gpt-6-astra.*`, `eyepop.qwen3.*` | —                   | no: every label must be unique    |

A request outside these limits fails for that source with a message such as `sam3 takes 1 to 8 'prompts' but received 9`. The VLMs reject two prompts with the same label; give each its own and merge them in your code.

#### How labels appear in the response

The label is the `classLabel` of whatever the ability produces, in the same [response format](https://docs.eyepop.ai/platform/response-format.md) as any other ability:

| Ability family | What carries the label                                         |
| -------------- | -------------------------------------------------------------- |
| classify       | `classes` on the prediction, or on the object a crop came from |
| detect         | `objects` with a box                                           |
| segment        | `objects` with a box and a `mask`                              |
| contour        | `objects` with a box and `contours`                            |

See [Objects](https://docs.eyepop.ai/platform/response-format/predictions/objects.md), [Classes and Texts](https://docs.eyepop.ai/platform/response-format/predictions/classes-and-texts.md) and [Masks, Contours and Depth](https://docs.eyepop.ai/platform/response-format/predictions/masks-contours-and-depth.md) for the shapes.

#### Confidence

Confidence means something different for each family, so compare scores **within** an ability, not across abilities.

* **CLIP** (`eyepop.clipv2.classify`) is calibrated, so a score near 0.9 means a strong match and a score near 0 means none. Every prompt gets a score of its own; they are not a probability distribution and do not add up to 1.
* **SigLIP2** (`eyepop.siglip2.classify`) returns raw sigmoid scores, which are typically low. On a busy photo the right answer can score around 0.03 and the wrong ones round to 0. Read its scores relative to each other: the highest is the answer, however small it is.
* **SAM3** scores combine how well a region matches the prompt with how sure the model is that the prompt is present in the image at all. Its decoder drops anything under 0.25, and the abilities' default threshold is 0.5.
* **Grounding DINO** scored the same objects lower than SAM3 did in our tests; its default threshold is 0.3.
* **VLMs** (`qwen3`, `gemini-4-argon`, `gpt-6-astra`) report the model's own confidence, and a classify request returns only the prompts that apply rather than a score for every prompt.

The component's `confidenceThreshold` applies to all of them, as it does to any ability, and overrides the default. On SAM3 a threshold under 0.25 brings back nothing more than 0.25 does.

#### Writing good prompts

* **Detectors (SAM3, Grounding DINO)** match short noun phrases best: `forklift`, `hard hat`, `red car`. On a group photo, `people` found all seven people where `person` found four above the default threshold; when a detector misses obvious objects, try a plural or a synonym, or lower `confidenceThreshold`.
* **Classifiers (CLIP, SigLIP2)** compare the whole image with a caption, so write the prompt as one: lowercase, short, `a photo of a bus` rather than `Bus`. Give the classifier the alternatives to choose between — `a person wearing sunglasses` *and* `a person without sunglasses` — because a score only means something next to the others.
* **VLMs** read the prompt as a question about the image, so they handle descriptions a contrastive model cannot: `an electric bus`, `a person holding a phone`.

## Catalog

| Ability                                 | Output                  | Model             | What it is for                                                                      |
| --------------------------------------- | ----------------------- | ----------------- | ----------------------------------------------------------------------------------- |
| `eyepop.clipv2.classify:latest`         | classes                 | CLIP              | Whole-image or per-crop classification against your prompts, with calibrated scores |
| `eyepop.siglip2.classify:latest`        | classes                 | SigLIP2           | The same, with a newer text-image model and uncalibrated, low scores                |
| `eyepop.sam3.detect:latest`             | boxes                   | SAM 3             | Find every instance of each prompt                                                  |
| `eyepop.sam3.segment:latest`            | boxes and masks         | SAM 3             | Find and segment every instance                                                     |
| `eyepop.sam3.contour:latest`            | boxes and polygons      | SAM 3             | Find every instance and trace its outline as a polygon                              |
| `eyepop.grounding-dino.detect:latest`   | boxes                   | MM-Grounding-DINO | Find every instance of each prompt, faster than SAM3                                |
| `eyepop.qwen3.classify:latest`          | classes                 | VLM               | Which prompts apply to the image                                                    |
| `eyepop.qwen3.detect:latest`            | boxes                   | VLM               | Find what the prompts describe                                                      |
| `eyepop.qwen3.event-classify:latest`    | classes per video chunk | VLM               | Which prompts' events happen in each chunk of a video                               |
| `eyepop.gemini-4-argon.classify:latest` | classes                 | VLM               | Which prompts apply to the image                                                    |
| `eyepop.gemini-4-argon.detect:latest`   | boxes                   | VLM               | Find what the prompts describe                                                      |
| `eyepop.gpt-6-astra.classify:latest`    | classes                 | VLM               | Which prompts apply to the image                                                    |
| `eyepop.gpt-6-astra.detect:latest`      | boxes                   | VLM               | Find what the prompts describe                                                      |

### Which one to pick

| You want                                             | Pick                                                                                                                                                                                                                                                        | Speed             | Video                   | Masks |
| ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ----------------------- | ----- |
| A label for the whole scene, on every frame          | [`eyepop.clipv2.classify`](https://docs.eyepop.ai/platform/abilities/open-vocabulary/classify-the-whole-image.md) (calibrated scores) or [`eyepop.siglip2.classify`](https://docs.eyepop.ai/platform/abilities/open-vocabulary/classify-the-whole-image.md) | fastest           | yes                     | —     |
| A label for each object, such as what a person wears | a detector, then CLIP or SigLIP2 on each crop: [Classify a detected object](https://docs.eyepop.ai/platform/abilities/open-vocabulary/classify-a-detected-object.md)                                                                                        | fast              | yes                     | —     |
| Boxes around things you name, on every frame         | [`eyepop.grounding-dino.detect`](https://docs.eyepop.ai/platform/abilities/open-vocabulary/detect-and-segment.md#grounding-dino-detect)                                                                                                                     | fast              | yes                     | —     |
| Boxes around things you name, finding more of them   | [`eyepop.sam3.detect`](https://docs.eyepop.ai/platform/abilities/open-vocabulary/detect-and-segment.md#sam3-detect)                                                                                                                                         | moderate          | yes                     | —     |
| The pixels or outline of each thing you name         | [`eyepop.sam3.segment`](https://docs.eyepop.ai/platform/abilities/open-vocabulary/detect-and-segment.md#sam3-segment) or [`eyepop.sam3.contour`](https://docs.eyepop.ai/platform/abilities/open-vocabulary/detect-and-segment.md#sam3-contour)              | moderate          | yes                     | yes   |
| An answer that needs reading or reasoning            | [`eyepop.qwen3`, `eyepop.gemini-4-argon` or `eyepop.gpt-6-astra`](https://docs.eyepop.ai/platform/abilities/open-vocabulary/promptable-vlm-tasks.md), as `classify` or `detect`                                                                             | seconds per image | sample with `targetFps` | —     |
| Which events or actions happen in a video, and when  | [`eyepop.qwen3.event-classify`](https://docs.eyepop.ai/platform/abilities/open-vocabulary/classify-an-event.md)                                                                                                                                             | seconds per chunk | yes, in chunks          | —     |

A good pattern combines them: a fast detector finds the objects on every frame, and a classifier or a VLM answers a question about each crop. See [Detect, then classify each crop](https://docs.eyepop.ai/platform/abilities/open-vocabulary/classify-a-detected-object.md#detect-then-classify-each-crop).

## Running the examples

The examples run on a street photo, 810 x 1080, of a blue electric minibus with people walking past it. The outputs were captured from production and trimmed; your numbers will differ slightly. The pictures draw each response onto the photo.

### Run a Pop on the photo

Each model on these pages is shown as a Pop. Save it as `pop.json` next to `street.jpg` and run it with this code, which prints the prediction:

{% tabs %}
{% tab title="Python" %}

```python
import json

from eyepop import EyePopSdk
from eyepop.worker.worker_types import Pop

pop = Pop.model_validate(json.load(open("pop.json")))

with EyePopSdk.sync_worker(pop=pop) as endpoint:
    result = endpoint.upload("street.jpg").predict()

print(json.dumps(result, indent=2))
```

{% endtab %}

{% tab title="Node" %}

```typescript
import { readFileSync } from 'node:fs'
import { EyePop, type Pop } from '@eyepop.ai/eyepop'

const pop: Pop = JSON.parse(readFileSync('pop.json', 'utf8'))
const endpoint = await EyePop.workerEndpoint({ pop }).connect()

try {
    const results = await endpoint.process({ source: { path: 'street.jpg' } })
    for await (const result of results) {
        console.log(JSON.stringify(result, null, 2))
    }
} finally {
    await endpoint.disconnect()
}
```

{% endtab %}
{% endtabs %}

### Prompt versus label

Several prompts can report under one label. Sneakers and boots are both shoes to this application:

{% tabs %}
{% tab title="Python" %}

```python
from eyepop import EyePopSdk
from eyepop.worker.worker_types import InferenceComponent, Pop

pop = Pop(components=[
    InferenceComponent(
        ability="eyepop.sam3.detect:latest",
        params={"prompts": [
            {"prompt": "sneakers", "label": "shoes"},
            {"prompt": "boots", "label": "shoes"},
        ]},
    ),
])

with EyePopSdk.sync_worker(pop=pop) as endpoint:
    result = endpoint.upload("street.jpg").predict()

for obj in result.get("objects", []):
    print(f"{obj['classLabel']} {obj['confidence']:.2f}  x={obj['x']:.0f} y={obj['y']:.0f}")
```

{% endtab %}

{% tab title="Node" %}

```typescript
import { EyePop, PopComponentType } from '@eyepop.ai/eyepop'

const endpoint = await EyePop.workerEndpoint({
    pop: {
        components: [
            {
                type: PopComponentType.INFERENCE,
                ability: 'eyepop.sam3.detect:latest',
                params: {
                    prompts: [
                        { prompt: 'sneakers', label: 'shoes' },
                        { prompt: 'boots', label: 'shoes' },
                    ],
                },
            },
        ],
    },
}).connect()

try {
    const results = await endpoint.process({ source: { path: 'street.jpg' } })
    for await (const result of results) {
        for (const obj of result.objects ?? []) {
            console.log(`${obj.classLabel} ${obj.confidence?.toFixed(2)}  x=${obj.x.toFixed(0)} y=${obj.y.toFixed(0)}`)
        }
    }
} finally {
    await endpoint.disconnect()
}
```

{% endtab %}
{% endtabs %}

```
shoes 0.87  x=280 y=779
shoes 0.95  x=670 y=823
shoes 0.92  x=51 y=851
shoes 0.91  x=176 y=853
shoes 0.91  x=255 y=819
```

Each prompt is matched on its own, and nothing merges their results. Two prompts that both match the same object report it twice: `sunglasses` and `glasses`, both labelled `eyewear`, return each pair of sunglasses on this photo once per prompt. Map synonyms to one label when they find **different** things; when they find the same thing, pick the one prompt that works best.

The VLMs do not accept two prompts with one label.

### Next steps

* [Classify the whole image](https://docs.eyepop.ai/platform/abilities/open-vocabulary/classify-the-whole-image.md), [Detect and segment](https://docs.eyepop.ai/platform/abilities/open-vocabulary/detect-and-segment.md), [Promptable VLM tasks](https://docs.eyepop.ai/platform/abilities/open-vocabulary/promptable-vlm-tasks.md) and [Recipes](https://docs.eyepop.ai/platform/abilities/open-vocabulary/recipes.md) — every ability with an example
* [Abilities](https://docs.eyepop.ai/platform/abilities.md) — fixed classes and open vocabulary, side by side
* [Pretrained, fixed classes](https://docs.eyepop.ai/platform/abilities/pretrained-fixed-classes.md) — the faster choice when a fixed label set covers your question
* [Component Parameters](https://docs.eyepop.ai/platform/sources-and-options/options/component-parameters.md) — prompts per source

Questions about building a Pop? Reach us at <help@eyepop.ai>.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.eyepop.ai/platform/abilities/open-vocabulary.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
