# AI Image Tagger & Zero-Shot Classifier (SigLIP, No API Key) (`freecamp008/image-tagger`) Actor

Auto-tag images with a self-hosted SigLIP AI model: 450+ built-in tags (objects, animals, scenes, activities, styles) plus your own custom labels for zero-shot classification. Scores per tag and optional image embeddings. No external APIs.

- **URL**: https://apify.com/freecamp008/image-tagger.md
- **Developed by:** [Camp8 fr0](https://apify.com/freecamp008) (community)
- **Categories:** AI, Developer tools, For creators
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 image taggeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## AI Image Tagger: Auto-Tag Images & Zero-Shot Image Classification (SigLIP, No API Key)

Automatically **tag images with keywords** and **classify images into your own categories** without training a model. The Actor runs Google's **SigLIP** vision-language model inside Apify (self-hosted, CPU) and scores each image against **480+ built-in tags** (people, animals, vehicles, places, nature, food, objects, clothing, activities, image style, colors) and any **custom labels** you provide. Optionally it returns the 768-d image embedding for your own vector search. No OpenAI, Google Vision or other paid API is used.

### What does AI Image Tagger do?

For each image URL, the Actor:

1. downloads and decodes the image,
2. computes a SigLIP image embedding,
3. compares it with the embeddings of the built-in tags (precomputed, so tagging is fast) and of your custom labels,
4. returns the **best tags with scores** and, for custom labels, the **best label with a probability** (zero-shot classification).

### Key features

- **480+ built-in tags** in 11 categories, each with its own score (multi-label: an image can be "beach", "sunset", "people" and "surfing" at once)
- **Zero-shot classification with your own labels**: product categories, damage types, scene types, brands of style... up to 1,000 labels, no training
- **Prompt template** for custom labels (`a photo of a {}.` by default)
- **Category filter**: only animals, only places, only style, ...
- **Image embeddings** (768-d, L2-normalized) for similarity search, clustering or a vector database
- **SigLIP scores are independent** (sigmoid), so tags do not compete with each other like in CLIP softmax classifiers
- **HTTP API (Standby mode)** with label embeddings cached between requests
- **Pay per image**; failed images are free

### Use cases

- **SEO and accessibility**: generate keywords and alt-text hints for image libraries
- **E-commerce catalog enrichment**: categorize product photos into your own taxonomy
- **Digital asset management (DAM)**: make photo archives searchable by subject, scene and style
- **Content moderation pre-filters**: route images by type (screenshot, document, meme, photo of a person)
- **Real estate and travel**: tag rooms, views and amenities (kitchen, pool, beach, mountain)
- **Data science**: weak labels for training sets, embeddings for deduplication and clustering

### How to use AI Image Tagger

#### In Apify Console

1. Paste image links into **Image URLs**.
2. Keep **Use built-in tag vocabulary** on, and/or enter **Custom labels** (one per line).
3. Click **Start**. Each row shows the image and its tags; custom-label results include `bestLabel`.

#### Via the Apify API

```bash
curl -X POST "https://api.apify.com/v2/acts/freecamp008~image-tagger/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"imageUrls": ["https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/savanna.jpg"], "customLabels": ["safari", "zoo", "farm"]}'
```

#### Standby mode (instant HTTP endpoint)

Standby keeps the model and tag embeddings in memory. Send the input as GET query parameters or as a POST JSON body; the response is `{ "count": n, "items": [...] }`.

```bash
## GET: arrays are comma-separated
curl "https://freecamp008--image-tagger.apify.actor/?token=YOUR_APIFY_TOKEN&imageUrls=https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg&customLabels=dog,cat,bird&useDefaultTags=false"

## POST
curl -X POST "https://freecamp008--image-tagger.apify.actor/?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"imageUrls": ["https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/new-york.jpg"], "tagCategories": ["places", "nature"], "topK": 5, "customLabels": ["New York", "Paris", "Tokyo"], "labelTemplate": "a photo of {}."}'
```

**AI agents can pay per call:** the Actor uses pay-per-event pricing and only default storages, so AI agents can call it and pay per request with **x402** through Apify.

### Input example

```json
{
  "imageUrls": ["https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/savanna.jpg"],
  "useDefaultTags": true,
  "customLabels": ["safari", "zoo", "farm"],
  "labelTemplate": "a photo of a {}.",
  "tagCategories": [],
  "topK": 15,
  "minScore": 0.001,
  "returnEmbedding": false
}
```

| Field | Description |
|---|---|
| `imageUrls` | Image links. One result per image. |
| `useDefaultTags` | Score the built-in vocabulary (default on). |
| `customLabels` | Your own labels for zero-shot classification (max 1,000). |
| `labelTemplate` | Prompt for custom labels; `{}` is replaced by the label. |
| `tagCategories` | Limit built-in tags to `people`, `animals`, `vehicles`, `places`, `nature`, `food`, `objects`, `clothing`, `activities`, `style`, `colors`. |
| `topK` | Max built-in tags per image (default 15). |
| `minScore` | Drop built-in tags below this score (default 0.001). |
| `returnEmbedding` | Add the 768-d image embedding. |

### Output example

```json
{
  "imageUrl": "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/savanna.jpg",
  "tags": ["savanna", "zebra", "giraffe", "wildlife", "animal"],
  "tagScores": [
    { "tag": "savanna", "category": "nature", "score": 0.32522 },
    { "tag": "zebra", "category": "animals", "score": 0.04576 },
    { "tag": "giraffe", "category": "animals", "score": 0.04021 },
    { "tag": "wildlife", "category": "animals", "score": 0.03703 },
    { "tag": "animal", "category": "animals", "score": 0.00313 }
  ],
  "bestLabel": "safari",
  "bestLabelProbability": 0.9954,
  "labels": [
    { "label": "safari", "score": 0.22958, "probability": 0.9954 },
    { "label": "zoo", "score": 0.00137, "probability": 0.0046 },
    { "label": "farm", "score": 0.00002, "probability": 0.0001 }
  ],
  "width": 540,
  "height": 360,
  "processingMs": 712
}
```

- `tagScores[].score` / `labels[].score`: SigLIP's independent match probability for that text (0-1).
- `labels[].probability`: softmax over your custom labels only, i.e. "which of my labels fits best" (sums to 1).
- Failed images produce `{ "imageUrl": "...", "error": "...", "isError": true }` and are **not charged**.

### Pricing

This Actor uses **pay-per-event** pricing:

| Event | Price | Per 1,000 |
|---|---|---|
| `image-tagged`: one image tagged with built-in tags and/or custom labels | $0.002 | **$2.00** |

Apify platform usage (compute, storage) is billed separately according to your plan. Use **Maximum cost per run** to cap spending.

### FAQ

**Why are the tag scores so small?**
SigLIP scores every tag independently with a sigmoid, and for a base-size model a clearly correct tag often scores between 0.005 and 0.3. The *ranking* is what matters: the first tags are the most relevant. The default `minScore` of 0.001 removes tags that do not fit. For a single best answer among your own categories, use `customLabels` and read `bestLabel` / `probability`.

**How good is the tagging?**
It recognizes common objects, animals, scenes, activities and image styles reliably (e.g. "savanna, zebra, giraffe, wildlife" or "soccer, sports, football, athlete"). It is weaker at counting, reading text, fine-grained identification (exact car model, dog breed variants, specific products), and small objects in busy scenes, because it looks at a 224 x 224 version of the whole image.

**Which languages are supported?**
Labels and tags must be in English (SigLIP base was trained on English text).

**What are the limits?**
Up to 1,000 custom labels per run, images up to 30 MB, animated GIFs use the first frame. At the default 2 GB memory expect about 1-2 s per image; more memory means more CPU and faster tagging.

**Are my images private?**
Yes. Images are processed by the model bundled with the Actor inside your Apify run; nothing is sent to an external AI service.

**Is it legal to use?**
Yes. Make sure you have the right to process the images you submit. The Actor does not identify people.

**Which model and license are used?**
[google/siglip-base-patch16-224](https://huggingface.co/google/siglip-base-patch16-224), **Apache-2.0** (commercial use allowed), run in fp32 via the ONNX export [Xenova/siglip-base-patch16-224](https://huggingface.co/Xenova/siglip-base-patch16-224) and transformers.js. The model and the embeddings of the built-in tags are bundled in the Actor image.

# Actor input Schema

## `imageUrls` (type: `array`):

Direct links to images (JPEG, PNG, WebP, AVIF, GIF, TIFF). Each image becomes one result with its tags.

## `useDefaultTags` (type: `boolean`):

Score every image against 450+ built-in tags (people, animals, vehicles, places, nature, food, objects, clothing, activities, image style, colors) and return the best ones.

## `customLabels` (type: `array`):

Your own labels, e.g. product categories (<code>sneakers</code>, <code>handbag</code>, <code>watch</code>) or anything you can describe in a few words (<code>damaged car</code>, <code>empty shelf</code>). Each result gets a score per label plus the best label with a probability across your labels. Up to 1,000 labels. English works best.

## `labelTemplate` (type: `string`):

How custom labels are turned into text for the model; <code>{}</code> is replaced by the label. The default <code>a photo of a {}.</code> works well for objects; use <code>{}</code> to send labels unchanged (e.g. full sentences).

## `tagCategories` (type: `array`):

Limit the built-in tags to some categories: <code>people</code>, <code>animals</code>, <code>vehicles</code>, <code>places</code>, <code>nature</code>, <code>food</code>, <code>objects</code>, <code>clothing</code>, <code>activities</code>, <code>style</code>, <code>colors</code>. Empty = all.

## `topK` (type: `integer`):

Return at most this many built-in tags per image, best first.

## `minScore` (type: `number`):

Built-in tags scoring below this are dropped. SigLIP scores are independent match probabilities and are usually small (a clearly correct tag often scores 0.005-0.3), so the ranking matters more than the absolute value. 0.001 keeps relevant tags and removes noise.

## `returnEmbedding` (type: `boolean`):

Add the 768-dimensional SigLIP image embedding (L2-normalized) to each result, e.g. for your own vector database or similarity search.

## Actor input object example

```json
{
  "imageUrls": [
    "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/savanna.jpg"
  ],
  "useDefaultTags": true,
  "customLabels": [],
  "labelTemplate": "a photo of a {}.",
  "tagCategories": [],
  "topK": 15,
  "minScore": 0.001,
  "returnEmbedding": false
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "imageUrls": [
        "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/savanna.jpg",
        "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/city-streets.jpg",
        "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("freecamp008/image-tagger").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "imageUrls": [
        "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/savanna.jpg",
        "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/city-streets.jpg",
        "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("freecamp008/image-tagger").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "imageUrls": [
    "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/savanna.jpg",
    "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/city-streets.jpg",
    "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg"
  ]
}' |
apify call freecamp008/image-tagger --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,freecamp008/image-tagger"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/4ytuF297BTpzfeRhm/builds/Alt9dhKJmtEuSUsXl/openapi.json
