Generated banner for Tao Generate Image Embeddings
Generated logo for Tao Generate Image Embeddings

Tao Generate Image Embeddings

NVIDIAOfficialCreated by NVIDIA Corporation

  • Skill
  • Tool integration
  • Data and AI
  • Apache-2.0
  • Medium risk
  • Has scripts

From the author

Run TAO Data Services image embedding to turn a parquet of image filepaths into an embedding parquet using CLIP, SigLIP, or a TAO checkpoint. Use when a workflow needs embeddings before nearest-neighbor or unique-neighbor mining, or when the user asks to "embed images", "compute image embeddings", or "generate SigLIP embeddings".
— the description by NVIDIA Corporation

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a standardized workflow for generating image embeddings using NVIDIA TAO Data Services. It processes a parquet file containing image paths and outputs a new parquet file enriched with embedding vectors. The skill supports multiple encoder models, including CLIP and SigLIP, and is designed to prepare data for downstream tasks such as nearest-neighbor or unique-neighbor mining. Maintaining consistency in the encoder model and configuration across all datasets is critical for ensuring the comparability of the resulting embeddings.

What it does

  • Converts image file paths from a parquet file into high-dimensional embedding vectors.
  • Supports multiple encoder architectures including CLIP, SigLIP, and custom TAO checkpoints.
  • Preserves existing metadata columns from the input parquet in the output file.
  • Provides a validation script to ensure configuration specs are correct before execution.
  • Allows for batch size adjustments to optimize GPU memory usage during processing.

When to use it

  • When you need to prepare image datasets for similarity search or neighbor mining.
  • When you need to generate consistent embeddings for multiple datasets to be compared later.
  • When you are working within a TAO-based pipeline and require image feature extraction.
  • When you need to switch between different pre-trained models like CLIP or SigLIP for image analysis.

Advantages

  • Ensures compatibility with downstream TAO mining tools.
  • Supports flexible model selection including standard HuggingFace models and custom TAO checkpoints.
  • Maintains data integrity by carrying through original metadata columns.
  • Includes validation tools to prevent configuration errors before starting resource-intensive GPU tasks.

Usage examples

“Generate embeddings for my images listed in images.parquet using the default SigLIP model.”
The agent will configure the embedding spec with SigLIP, validate it, and run the TAO Data Services container to produce an output parquet containing the image embeddings.
“I need to re-embed my dataset using CLIP instead of SigLIP for a new mining run.”
The agent will update the model and model_path fields in your experiment spec to the CLIP configuration, validate the changes, and execute the embedding process.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/nvidia/tao-generate-image-embeddings/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip tao-generate-image-embeddings.zip -d .agents/skills

Documentation by NVIDIA Corporation

TAO Generate Image Embeddings

Use this skill to run TAO Data Services image embedding. The skill consumes a parquet of image filepaths and writes a parquet with an embedding column. Downstream mining skills (tao-mine-od-images, tao-mine-nearest-neighbors) consume its output.

The container entrypoint is:

embedding image_embeddings -e /absolute/path/to/image_embeddings.yaml

Inputs

The user can provide either an existing spec or the fields needed to generate one.

Required spec fields:

FieldMeaning
input_parquetAbsolute path to a parquet containing image filepaths.
output_parquetAbsolute path where the embedding parquet is written.
modelCLIP or SigLIP.
model_pathHuggingFace model id, local HF snapshot directory, or a TAO .pth/.ckpt checkpoint. Must match model. SigLIP: google/siglip-base-patch16-224 (768-dim, the template default). CLIP: openai/clip-vit-base-patch32 (512-dim). The validator rejects a recognizable model/path mismatch before launch.

Common optional fields:

FieldDefaultMeaning
model_config_path""TAO experiment spec path. Required only when model_path is a TAO checkpoint.
batch_size64Number of images processed in parallel. Lower it if the GPU runs out of memory.

The input parquet must contain a filepath column. Any additional columns are carried through to the output verbatim, so metadata such as label survives into the embedding parquet.

filepath values are transitive file inputs. When another workflow emits this spec, its platform action request must declare and mount every image root those paths reference; mounting only input_parquet is insufficient. Keep these mount-only folder inputs outside the native embedding YAML, because the Data Services config has no image_root field. If the producing workflow freezes absolute paths, each embedding container must remount the corresponding source at the same compute-visible root.

The default template is assets/default_image_embeddings.yaml.

Encoder Consistency

When embeddings feed a mining step, every parquet compared against another must be produced with the same model and model_path. Embedding dimensionality follows the encoder — 768 for the SigLIP default, 512 for CLIP ViT-B/32 — and nothing in the output parquet records which encoder wrote it. Embeddings from different encoders are not comparable, and mismatched encoders are the most common cause of mining output that looks unrelated to the targets. Reuse one spec across every parquet in a mining run and override only input_parquet / output_parquet.

Quick Start

Run from the tao-skill-bank repo root.

Write the spec beside the output parquet. The run does not retain it, so the embeddings otherwise carry no record of the encoder that produced them. That matters here more than elsewhere: every parquet compared against another in a mining step must come from the same model and model_path, and mismatched encoders are the usual cause of mining output that looks unrelated to its targets.

OUT_DIR=/absolute/path/for/this/run              # where output_parquet is written
SPEC="$OUT_DIR/image_embeddings.yaml"            # spec lives beside its output
RUN_ROOT=/absolute/path/that/contains/parquets/images/and/results
GPU_COUNT=1

python3 skills/data/tao-generate-image-embeddings/scripts/verify_image_embeddings_spec.py \
  --spec "$SPEC"

DS_IMAGE="$(scripts/resolve_versions_key.py images.tao_toolkit.data_services)"

RUNTIME_HOME="$RUN_ROOT/.tao-runtime/home"
HF_CACHE="$HOME/.cache/huggingface"
mkdir -p "$RUNTIME_HOME/.cache" "$HF_CACHE"
IDENTITY_ARGS=(--user "$(id -u):$(id -g)"
  -e USER="$(id -un)" -e LOGNAME="$(id -un)"
  -e HOME="$RUNTIME_HOME" -e XDG_CACHE_HOME="$RUNTIME_HOME/.cache"
  -e HF_HOME="$HF_CACHE" -v "$HF_CACHE:$HF_CACHE")

docker run --rm --gpus "$GPU_COUNT" --shm-size=8g --network=host \
  "${IDENTITY_ARGS[@]}" \
  -v "$RUN_ROOT:$RUN_ROOT" \
  -w "$RUN_ROOT" \
  "$DS_IMAGE" \
  embedding image_embeddings -e "$SPEC"

Keep --user and the identity env block above. The image imports transformers at startup, which calls getpass.getuser(); without USER/LOGNAME it fails with KeyError: 'getpwuid(): uid not found: <uid>' because the UID has no /etc/passwd entry. Do not work around it by running the container as root; that leaves root-owned outputs. This follows the launch contract in tao-run-on-docker.

To embed several parquets with one encoder, reuse the same spec and override the two paths per run:

docker run --rm --gpus "$GPU_COUNT" --shm-size=8g --network=host "${IDENTITY_ARGS[@]}" \
  -v "$RUN_ROOT:$RUN_ROOT" -w "$RUN_ROOT" "$DS_IMAGE" \
  embedding image_embeddings -e "$SPEC" \
  input_parquet=/abs/path/other_input.parquet \
  output_parquet=/abs/path/other_output.parquet

Generate A Spec

If the user provides parquet paths and an encoder instead of a ready spec, copy the template and fill in the nulls. Every tuning value it already carries is the one this stage wants — change one only deliberately.

cp skills/data/tao-generate-image-embeddings/assets/default_image_embeddings.yaml "$SPEC"

Fill input_parquet, output_parquet and — if not using the default encoder — model and model_path, all as absolute paths, then validate:

python3 skills/data/tao-generate-image-embeddings/scripts/verify_image_embeddings_spec.py --spec "$SPEC"
input_parquet: /absolute/path/filepaths.parquet
output_parquet: /absolute/path/results/embeddings.parquet
model: SigLIP
model_path: google/siglip-base-patch16-224
model_config_path: ""          # required only when model_path is a TAO .pth/.ckpt
batch_size: 64

The template is the only place a default value lives, so nothing can disagree with it. verify reports the encoder, since embeddings are only comparable to others produced by the same model and model_path.

Keep the spec, input parquet, image files, and output directory under RUN_ROOT so the same paths resolve inside the container.

Preflight

  1. Verify Docker and GPU access:

docker info > /dev/null
nvidia-smi -L
  1. Resolve and pull the data-services image if needed:

DS_IMAGE="$(scripts/resolve_versions_key.py images.tao_toolkit.data_services)"
docker image inspect "$DS_IMAGE" > /dev/null || docker pull "$DS_IMAGE"
  1. Validate the spec:

python3 skills/data/tao-generate-image-embeddings/scripts/verify_image_embeddings_spec.py \
  --spec "$SPEC"
  1. Confirm RUN_ROOT contains the spec, the input parquet, the image files its filepath column points at, and the output directory. Mount RUN_ROOT to the same absolute path inside Docker.

Outputs

ArtifactLocation
embedding parquetoutput_parquet

The output parquet contains filepath, an embedding column of list-like vectors, and every extra column carried through from the input. Print its row count and column list after the run so the caller can confirm the embedding column exists.

Troubleshooting

The subtask image_embeddings requires -e/--experiment_spec_file: rerun with embedding image_embeddings -e "$SPEC".

Input parquet or images not found inside Docker: the filepath values are read verbatim. Use a RUN_ROOT mount where host and container paths are identical, and confirm the images themselves are under that mount — not just the parquet.

Model loading error with a .pth / .ckpt model_path: TAO checkpoints need model_config_path set to the training spec so the architecture can be rebuilt. HuggingFace ids and snapshot directories do not.

CUDA out of memory: lower batch_size (try 32 or 16).

Mined results look unrelated downstream: the parquets compared during mining were embedded with different encoders. Re-embed them with one shared spec — see ## Encoder Consistency.

No GPU available: embedding requires at least one CUDA GPU. Check nvidia-smi -L, the Docker --gpus flag, and the NVIDIA container toolkit installation.

Files

scripts/verify_image_embeddings_spec.py

#!/usr/bin/env python3
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

"""Validate a TAO Data Services image-embeddings spec.

Fill `assets/default_image_embeddings.yaml` — it carries every default this stage
needs — then run this against the result. The template is the only place a
default value lives, so there is nothing that can disagree with it.

Checks the spec against what `embedding image_embeddings` actually requires:

- `input_parquet`, `output_parquet`, `model` and `model_path` are present, and
  the two paths are absolute.
- `input_parquet` exists and is a file; `output_parquet`'s parent is created and
  probed for writability, so a run does not fail after doing the work.
- `model` is `CLIP` or `SigLIP`.
- `model_config_path` is set when `model_path` is a TAO checkpoint — a `.pth` or
  `.ckpt` cannot be rebuilt without the spec it was trained under.

It also reports the encoder, because embeddings are only comparable to others
produced by the same `model` and `model_path`. A mining step that compares
parquets from different encoders returns neighbours unrelated to its targets,
and nothing in the parquet records which encoder wrote it.
"""

from __future__ import annotations

import argparse
import sys
from pathlib import Path
from typing import Any

import yaml

VALID_MODELS = {"CLIP", "SigLIP"}
TAO_CKPT_SUFFIXES = {".pth", ".ckpt"}


def load_yaml(path: Path) -> dict[str, Any]:
    with path.open("r", encoding="utf-8") as fh:
        data = yaml.safe_load(fh) or {}
    if not isinstance(data, dict):
        raise ValueError(f"{path} must contain a YAML mapping.")
    return data


def validate_config(config: dict[str, Any]) -> None:
    required = ("input_parquet", "output_parquet", "model", "model_path")
    missing = [
        key
        for key in required
        if not isinstance(config.get(key), str) or not config[key].strip()
    ]
    if missing:
        raise ValueError(f"Missing required field(s): {', '.join(missing)}")

    src = Path(str(config["input_parquet"])).expanduser()
    if not src.is_absolute():
        raise ValueError(f"input_parquet must be absolute: {src}")
    if not src.is_file():
        raise FileNotFoundError(f"input_parquet does not exist or is not a file: {src}")

    out = Path(str(config["output_parquet"])).expanduser()
    if not out.is_absolute():
        raise ValueError(f"output_parquet must be absolute: {out}")
    out.parent.mkdir(parents=True, exist_ok=True)
    try:
        probe = out.parent / ".tao_image_embeddings_write_test"
        probe.write_text("ok\n", encoding="utf-8")
        probe.unlink()
    except OSError as exc:
        raise PermissionError(f"output_parquet parent is not writable: {out.parent}") from exc

    model = config["model"]
    if model not in VALID_MODELS:
        raise ValueError(f"model must be one of {sorted(VALID_MODELS)}.")
    config["model"] = model

    # `model` selects the loader and `model_path` the weights, and they are otherwise
    # independent — a SigLIP path under model: CLIP passes every other check here and
    # fails inside the container, or worse loads something that embeds badly.
    mp = config["model_path"].lower()
    for name, marker in (("SigLIP", "siglip"), ("CLIP", "clip")):
        if marker in mp and model != name and not (name == "CLIP" and "siglip" in mp):
            raise ValueError(
                f"model is {model!r} but model_path names {name} ({config['model_path']}). "
                "The two must agree — they select the loader and the weights separately."
            )

    # A TAO checkpoint cannot be rebuilt without its training spec.
    model_path = config["model_path"]
    if Path(model_path).suffix in TAO_CKPT_SUFFIXES and not config.get("model_config_path"):
        raise ValueError(
            "model_config_path is required when model_path is a TAO checkpoint "
            f"({Path(model_path).suffix})."
        )

    batch_size = config.get("batch_size", 64)
    if isinstance(batch_size, bool) or not isinstance(batch_size, int) or batch_size < 1:
        raise ValueError("batch_size must be an integer of at least 1.")
    config["batch_size"] = batch_size
    model_config_path = config.get("model_config_path", "")
    if not isinstance(model_config_path, str):
        raise ValueError("model_config_path must be a string.")
    config["model_config_path"] = model_config_path


def parse_args() -> argparse.Namespace:
    parser = argparse.ArgumentParser(description=__doc__,
                                     formatter_class=argparse.RawDescriptionHelpFormatter)
    parser.add_argument("--spec", required=True, help="Path to the image-embeddings YAML.")
    return parser.parse_args()


def main() -> int:
    try:
        spec = Path(parse_args().spec).expanduser().resolve()
        config = load_yaml(spec)
        validate_config(config)
        print(f"OK: image-embeddings spec is valid: {spec}")
        print(f"Encoder: {config['model']} @ {config['model_path']}")
        print(f"Output parquet: {config['output_parquet']}")
        out_dir = Path(str(config["output_parquet"])).expanduser().resolve().parent
        if spec.parent != out_dir:
            print(f"WARNING: the spec is outside the output directory ({spec.parent} vs "
                  f"{out_dir}). The run does not copy it, so the embeddings will carry no record "
                  f"of the encoder that produced them. Author it at {out_dir / spec.name} "
                  "instead — embeddings compared against each other must come from the same "
                  "model and model_path, and that is unknowable after the fact otherwise.",
                  file=sys.stderr)
        return 0
    except Exception as exc:  # noqa: BLE001
        print(f"ERROR: {exc}", file=sys.stderr)
        return 1


if __name__ == "__main__":
    raise SystemExit(main())

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Declares allowed tools, Needs a command-line tool, Needs Python

The author says: Requires docker, nvidia-container-toolkit, one or more CUDA GPUs, and the TAO data-services container pinned in versions.yaml.

Security

What our scanner noticed· Medium risk

  • Large base64-encoded blobs
  • References to credential files
  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
NVIDIA Corporation
Publisher
NVIDIA (Official)
Source
NVIDIA/skills · skills/tao-generate-image-embeddings · commit fce3cca
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE-APACHE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by NVIDIA Corporation or NVIDIA.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download tao-generate-image-embeddings.zip