> 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/recipes.md). Agents can also search and read this documentation through its [MCP server](https://docs.eyepop.ai/~gitbook/mcp).

# Recipes

Open-vocabulary Pops that combine abilities — per-source prompts and asking a VLM about each crop

Pops that combine the open-vocabulary abilities. They 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.

### A different question for every image

Give the component an `id` and no prompts in the Pop, then send the prompts with each source as [component parameters](https://docs.eyepop.ai/platform/sources-and-options/options/component-parameters.md). One session answers a different question per image.

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

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

pop = Pop(components=[
    InferenceComponent(id=1, ability="eyepop.sam3.detect:latest"),
])

questions = {
    "street.jpg": [{"prompt": "bus"}, {"prompt": "bollard"}],
    "group.png": [{"prompt": "sneakers"}],
}

with EyePopSdk.sync_worker(pop=pop) as endpoint:
    for path, prompts in questions.items():
        result = endpoint.upload(
            path,
            params=[ComponentParams(componentId=1, values={"prompts": prompts})],
        ).predict()
        labels = [obj["classLabel"] for obj in result.get("objects", [])]
        print(path, sorted(labels))
```

{% endtab %}

{% tab title="Node" %}

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

const endpoint = await EyePop.workerEndpoint({
    pop: {
        components: [
            { type: PopComponentType.INFERENCE, id: 1, ability: 'eyepop.sam3.detect:latest' },
        ],
    },
}).connect()

const questions: Record<string, { prompt: string; label?: string }[]> = {
    'street.jpg': [{ prompt: 'bus' }, { prompt: 'bollard' }],
    'group.png': [{ prompt: 'sneakers' }],
}

try {
    for (const [path, prompts] of Object.entries(questions)) {
        const results = await endpoint.process({
            source: { path },
            componentParams: [{ componentId: 1, values: { prompts } }],
        })
        for await (const result of results) {
            const labels = (result.objects ?? []).map((obj) => obj.classLabel).sort()
            console.log(path, labels)
        }
    }
} finally {
    await endpoint.disconnect()
}
```

{% endtab %}
{% endtabs %}

```
street.jpg ['bollard', 'bollard', 'bollard', 'bus']
group.png ['sneakers', 'sneakers', 'sneakers', 'sneakers', 'sneakers', 'sneakers', 'sneakers', 'sneakers', 'sneakers', 'sneakers', 'sneakers', 'sneakers', 'sneakers']
```

`group.png` is a group photo of seven people standing in a row.

<figure><img src="https://1072321683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDoCvfjveqiJFmk0cnXCp%2Fuploads%2Fgit-blob-7c1c48a6b4a10fed88f4fb79942a745530f8bebe%2Fopen-vocabulary-per-source.jpg?alt=media" alt="Left: the street photo with boxes around the bus and three bollards. Right: the group photo with a box around each sneaker"><figcaption><p>One session, two questions: <code>bus</code> and <code>bollard</code> for the street photo, <code>sneakers</code> for the group photo.</p></figcaption></figure>

### Detect, then classify each crop

Classifying each object a detector finds has a page of its own: [Classify a detected object](https://docs.eyepop.ai/platform/abilities/open-vocabulary/classify-a-detected-object.md).

### Ask a VLM instead

A contrastive classifier answers well when the difference is visible at a glance. When the question needs a closer look — is this person holding a phone? — ask a VLM. The Pop is the one in [Detect, then classify each crop](https://docs.eyepop.ai/platform/abilities/open-vocabulary/classify-a-detected-object.md#detect-then-classify-each-crop); only the classifier changes:

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

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

pop = Pop(components=[
    InferenceComponent(
        ability="eyepop.sam3.detect:latest",
        params={"prompts": [{"prompt": "person"}]},
        forward=CropForward(targets=[
            InferenceComponent(
                ability="eyepop.gemini-4-argon.classify:latest",
                params={"prompts": [
                    {"prompt": "a person wearing sunglasses", "label": "sunglasses"},
                    {"prompt": "a person holding a phone", "label": "phone in hand"},
                ]},
            ),
        ]),
    ),
])

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

for person in result.get("objects", []):
    labels = [c["classLabel"] for c in person.get("classes", [])]
    print(f"person at x={person['x']:.0f}: {labels}")
```

{% endtab %}

{% tab title="Node" %}

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

const endpoint = await EyePop.workerEndpoint({
    pop: {
        components: [
            {
                type: PopComponentType.INFERENCE,
                ability: 'eyepop.sam3.detect:latest',
                params: { prompts: [{ prompt: 'person' }] },
                forward: {
                    operator: { type: ForwardOperatorType.CROP },
                    targets: [
                        {
                            type: PopComponentType.INFERENCE,
                            ability: 'eyepop.gemini-4-argon.classify:latest',
                            params: {
                                prompts: [
                                    { prompt: 'a person wearing sunglasses', label: 'sunglasses' },
                                    { prompt: 'a person holding a phone', label: 'phone in hand' },
                                ],
                            },
                        },
                    ],
                },
            },
        ],
    },
}).connect()

try {
    const results = await endpoint.process({ source: { path: 'street.jpg' } })
    for await (const result of results) {
        for (const person of result.objects ?? []) {
            const labels = (person.classes ?? []).map((c) => c.classLabel)
            console.log(`person at x=${person.x.toFixed(0)}:`, labels)
        }
    }
} finally {
    await endpoint.disconnect()
}
```

{% endtab %}
{% endtabs %}

```
person at x=671: []
person at x=0: []
person at x=51: ['sunglasses']
person at x=225: ['sunglasses', 'phone in hand']
```

<figure><img src="https://1072321683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDoCvfjveqiJFmk0cnXCp%2Fuploads%2Fgit-blob-b5b4674c4d79eb18aaa247acdf3085f280faad73%2Fopen-vocabulary-crop-vlm.jpg?alt=media" alt="The street photo with a box around each of the four people: sunglasses for the man on the left, sunglasses and phone in hand for the man in the black coat, none for the other two" width="400"><figcaption><p>The VLM's answers on each person's crop. A person matching no prompt has no classes.</p></figcaption></figure>

A VLM classify returns only the prompts that apply, so a person matching none gets no `classes` at all, and the two prompts are independent questions rather than alternatives. A VLM looks at each crop in more depth than CLIP, which is why this Pop takes seconds where the CLIP version takes a fraction of one. `eyepop.qwen3.classify` and `eyepop.gpt-6-astra.classify` take the same prompts.

To find objects with a VLM rather than classify them, use its `detect` ability with the same prompts; see [VLMs: detect](https://docs.eyepop.ai/platform/abilities/open-vocabulary/promptable-vlm-tasks.md#vlms-detect).

### Next steps

* [Open vocabulary](https://docs.eyepop.ai/platform/abilities/open-vocabulary.md) — the `prompts` parameter and the catalog
* [Forwarding](https://docs.eyepop.ai/platform/pop/pop-forwarding.md) — chaining a detector into a classifier
* [Examples](https://docs.eyepop.ai/platform/pop/pop-examples.md) — more complete Pops

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/recipes.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.
