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

# Classify the whole image

Classify a whole image or a crop against captions you write, with CLIP or SigLIP2

`eyepop.clipv2.classify` and `eyepop.siglip2.classify` score each of your prompts against the image: CLIP with calibrated scores, SigLIP2 with uncalibrated, low ones. Each Pop below runs on the street photo with the code in [Running the examples](https://docs.eyepop.ai/platform/abilities/open-vocabulary.md#running-the-examples), which prints the prediction. The outputs were captured from production and trimmed; your numbers will differ slightly. The pictures draw each response onto the photo.

{% hint style="info" %}
**CLIP and SigLIP2 classify the whole picture.** They score how well each prompt describes the entire scene. They are good at "is this a street, a kitchen or a beach" and poor at details that fill only a small part of the image, such as whether one of the people in a street scene wears sunglasses. For a detail, detect it first and classify the crop, so the detail is the whole picture the classifier sees. See [Detect, then classify each crop](https://docs.eyepop.ai/platform/abilities/open-vocabulary/classify-a-detected-object.md#detect-then-classify-each-crop).
{% endhint %}

### CLIP: classify a scene

Four candidate captions, one image. Each prompt reads as a caption; each label is the name the application wants back.

```json
{
  "components": [
    {
      "type": "inference",
      "ability": "eyepop.clipv2.classify:latest",
      "params": {
        "prompts": [
          { "prompt": "a photo of a bus", "label": "bus" },
          { "prompt": "a photo of a street", "label": "street" },
          { "prompt": "a photo of a kitchen", "label": "kitchen" },
          { "prompt": "a photo of a beach", "label": "beach" }
        ]
      }
    }
  ]
}
```

```json
"classes": [
  { "classLabel": "bus", "confidence": 0.9891 },
  { "classLabel": "street", "confidence": 0.1547 },
  { "classLabel": "kitchen", "confidence": 0.0003 },
  { "classLabel": "beach", "confidence": 0.0001 }
]
```

<figure><img src="https://1072321683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDoCvfjveqiJFmk0cnXCp%2Fuploads%2Fgit-blob-ae14dce4822423b43be70ded035eae95e53840c8%2Fopen-vocabulary-clipv2-classify.jpg?alt=media" alt="The street photo with a bar chart below it: bus 0.9891, street 0.1547, kitchen 0.0003, beach 0.0001" width="400"><figcaption><p>CLIP scores every prompt against the whole photo.</p></figcaption></figure>

Both `bus` and `street` are true of this photo. The bus fills the frame, so it wins clearly; the scores are independent, so `street` still gets a score of its own rather than what is left over.

### SigLIP2: classify a scene

SigLIP2 scores how well a caption describes the **entire** picture. A short prompt that names one thing in the photo scores low even when it is true; a caption that describes the whole scene scores high. This Pop gives it both kinds:

```json
{
  "components": [
    {
      "type": "inference",
      "ability": "eyepop.siglip2.classify:latest",
      "params": {
        "prompts": [
          { "prompt": "a blue electric minibus parked on a city street with people walking past it", "label": "blue minibus street scene" },
          { "prompt": "a red double-decker bus on a city street with people on the sidewalk", "label": "red double-decker street scene" },
          { "prompt": "a photo of a bus", "label": "bus" },
          { "prompt": "a photo of a street", "label": "street" },
          { "prompt": "a man wearing sunglasses", "label": "one detail" }
        ]
      }
    }
  ]
}
```

```json
"classes": [
  { "classLabel": "blue minibus street scene", "confidence": 0.9605 },
  { "classLabel": "red double-decker street scene", "confidence": 0.0008 },
  { "classLabel": "bus", "confidence": 0.0267 },
  { "classLabel": "street", "confidence": 0 },
  { "classLabel": "one detail", "confidence": 0 }
]
```

<figure><img src="https://1072321683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDoCvfjveqiJFmk0cnXCp%2Fuploads%2Fgit-blob-6f169df3e965700382d65bc8652e991546bc7860%2Fopen-vocabulary-siglip2-classify.jpg?alt=media" alt="The street photo with a bar chart below it: blue minibus street scene 0.9605, red double-decker street scene 0.0008, bus 0.0267, street 0, one detail 0" width="400"><figcaption><p>A caption of the whole scene scores 0.96; true prompts about one part of it score close to 0.</p></figcaption></figure>

`blue minibus street scene`, a caption that describes everything in the photo, scores 0.96. `red double-decker street scene`, a caption of a similar street with a different bus, scores almost nothing. So do the short prompts `bus` and `street`, though both are true, and `one detail`, though a man in the photo does wear sunglasses. Read SigLIP2's scores relative to each other — the highest is the answer, however small — and when you want a confident match, describe the whole scene. See [Confidence](https://docs.eyepop.ai/platform/abilities/open-vocabulary.md#confidence), and [Detect, then classify each crop](https://docs.eyepop.ai/platform/abilities/open-vocabulary/classify-a-detected-object.md#detect-then-classify-each-crop) for asking about a detail.

### Next steps

* [Open vocabulary](https://docs.eyepop.ai/platform/abilities/open-vocabulary.md) — the `prompts` parameter, limits and confidence
* [Classify a detected object](https://docs.eyepop.ai/platform/abilities/open-vocabulary/classify-a-detected-object.md) — classify each crop of a detector

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/classify-the-whole-image.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.
