New to Claude Skills? Learn how to install them →

nvidia on GitHub

Image Grounding Pipeline

OfficialFree

Generate pixel-space annotations from images and captions.

by nvidia2.8k stars on nvidia/skills
1 views
Updated Aug 7, 2026
Get this skill

Free · Opens the source repo

What Image Grounding Pipeline does

The Image Grounding Pipeline provides a structured approach to generating phrase-grounded annotations from image and caption pairs. It utilizes a Vision Language Model (VLM) to extract referring expressions from captions and ground them into pixel-space bounding boxes. This two-step process allows users to create accurate training data for models focused on referring expressions and image grounding. The pipeline is particularly useful for researchers and developers working in computer vision and natural language processing, enabling them to automate the annotation of images based on textual descriptions.

In the first step of the pipeline, the VLM cleans the provided caption and extracts referring expressions along with their character spans. This is essential for understanding which parts of the caption correspond to specific elements within the image. The second step grounds these expressions into pixel-space bounding boxes, providing a visual reference for each identified expression. Users can choose to run the full pipeline or select individual steps based on their requirements, allowing for flexibility in processing.

The skill is designed to facilitate the auto-labeling of images, making it easier to generate datasets for training machine learning models. By automating the annotation process, it saves time and reduces the potential for human error. The pipeline supports various VLM endpoints, including Gemini and OpenAI-compatible models, giving users the flexibility to choose the best model for their needs. The ability to resume processing from checkpoints also enhances efficiency, allowing users to manage large datasets effectively.

When to use it

Use this skill when you need to create training data for image grounding tasks or when you want to auto-label images based on textual descriptions.

When not to use it

This skill may not be suitable for scenarios where manual annotation is preferred or when dealing with images that do not have accompanying captions.

What you can build with it

Generating Training Data

Use the pipeline to create annotated datasets for training models in image grounding and referring expressions.

Automating Image Labeling

Leverage the skill to auto-label images based on their captions, significantly reducing manual effort.

Testing VLM Performance

Run the pipeline on a small dataset to evaluate the performance of different VLM models before scaling up.

How to install Image Grounding Pipeline

View source

1. Install with the skills CLI

npx skills add nvidia/skills/tao-generate-image-grounding --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by nvidia

Image Grounding Pipeline

Turn (image, caption) pairs into per-image grounded annotations: cleaned captions, referring expressions with character spans, and pixel-space bounding boxes for each expression. A single VLM (Gemini or any OpenAI-compatible endpoint) handles both steps.

Purpose

Generate phrase-grounded training data for referring-expression and grounding models. The VLM acts as a "teacher" annotator: Step 0 extracts referring expressions from the caption while looking at the image; Step 1 returns one bbox set per expression for each image.

Pipeline Architecture

Step 0: Expression extraction  → VLM cleans caption, extracts referring expressions + char spans
Step 1: Phrase grounding       → VLM returns pixel bboxes + scores per expression

Steps are individually selectable via workflow.steps. Each step writes a per-sample checkpoint to step_<N>_*/.ckpt/<sample_id>.json and skips already-processed records on re-run. Set workflow.force_reprocess: true to ignore checkpoints and reprocess from scratch.

Instructions

Initial setup

When a user wants to run this pipeline, walk through these steps:

  1. Input JSONL: Ask for the JSONL path. Each line must be one object like {"image_path": "...", "caption": "..."}. image_path can be absolute or relative.

  2. Image root: If any image_path values are relative, set data.image_root to the directory they should resolve from.

  3. API access: Ask the user which VLM endpoint they want to use. Present these five options and act on the choice:

    1. Gemini — set vlm.backend: "gemini"; require GOOGLE_API_KEY (env var or vlm.gemini.api_key).
    2. NIM (e.g. https://inference-api.nvidia.com/v1) — set vlm.backend: "openai"; collect base_url, model_name, and api_key.
    3. TAO inference microservice (self-hosted, OpenAI-compatible). Confirm whether the server is already running:
      • Running — collect base_url, model_name, and (optionally) api_key; set vlm.backend: "openai".
      • Not running — guide the user through the skills/applications/tao-run-inference-service skill, which stands up a local TAO inference microservice with an OpenAI-compatible API. Before promising a specific model, check skills/applications/tao-run-inference-service/references/service.yaml for valid_network_arch_config_basenames. Once the server is up, collect base_url, model_name, and (optionally) api_key; set vlm.backend: "openai".
    4. vLLM (self-hosted, OpenAI-compatible). Confirm whether the server is already running:
      • Running — collect base_url, model_name, and (optionally) api_key; set vlm.backend: "openai".
      • Not running — follow references/vllm_server.md to install and launch a vLLM server, then collect base_url, model_name, and (optionally) api_key; set vlm.backend: "openai".
    5. Custom (any other OpenAI-compatible endpoint) — set vlm.backend: "openai"; collect base_url, model_name, and (optionally) api_key.

    If the user has no endpoint and does not want to set one up, stop and help resolve API access first.

  4. Workflow steps: Choose one of:

    • Full pipeline: ["0", "1"]
    • Expression extraction only: ["0"]
    • Grounding only: ["1"], which requires existing step-0 output at results_dir/step_0_expression_extraction/annotations.jsonl
  5. Resume vs fresh run: By default, the workflow reuses checkpoints and skips completed records. To reprocess everything, set image_grounding.workflow.force_reprocess=true.

Running the pipeline

The pipeline runs inside the TAO Toolkit container via the auto_label CLI:

auto_label generate -e /path/to/spec.yaml \
    results_dir=/results \
    image_grounding.data.input_jsonl=/data/captions.jsonl \
    image_grounding.data.image_root=/data/images \
    image_grounding.vlm.gemini.api_key=$GOOGLE_API_KEY

Generate a default spec: auto_label default_specs results_dir=/results module_name=auto_label, then set autolabel_type: "image_grounding". All fields support Hydra dot-notation overrides on the command line.

See references/configuration.md for the full YAML structure, all parameters, model/endpoint setup, and error patterns.

Recommended pilot workflow

  1. Run on 5-10 images with both steps
  2. Inspect step_0_expression_extraction/annotations.jsonl — are cleaned_caption and expressions[] accurate? Are the right noun phrases captured?
  3. Inspect step_1_grounding/annotations.jsonl — do the bboxes in expressions[].instances[] look right? Are confidence scores reasonable?
  4. If quality is insufficient, switch the VLM to a stronger model (e.g. gemini-2.5-pro) or raise media_resolution/max_output_tokens, then re-run with force_reprocess=true.
  5. Scale to the full dataset once satisfied.

Configuration

Key configuration fields (full reference in references/configuration.md):

FieldDefaultDescription
workflow.steps["0","1"]Which pipeline steps to execute ("0" = expressions, "1" = grounding)
workflow.max_workers4Parallel threads per step (watch API rate limits)
workflow.force_reprocessfalseIgnore per-sample checkpoints and reprocess from scratch
vlm.backend"gemini""gemini" or "openai" (OpenAI-compatible endpoint)
data.input_jsonlrequiredPath to input JSONL with image_path + caption per line
data.image_root""Optional prefix for resolving relative image_path entries

Inputs

A single JSONL file at data.input_jsonl. One JSON object per line:

FieldRequiredDescription
image_pathyesAbsolute path, or relative path resolved against data.image_root
captionyesFree-text caption for the image
image_idnoStable identifier; auto-derived from the filename if missing
width, heightnoImage dimensions in pixels; default to 1920×1080 for bbox clamping if missing

Outputs

All outputs go to results_dir/:

  • step_0_expression_extraction/annotations.jsonl — per-record output enriched with cleaned_caption and expressions[] (each with text, expression_id, char_span, noun_chunk, empty instances[]).
  • step_1_grounding/annotations.jsonl — same records with expressions[].instances[] filled in (each instance has bbox: [x1,y1,x2,y2] in pixel space, score in [0.0, 1.0], and bbox_id).
  • results_dir/annotations.jsonl — copy of the last step's output for convenience.
  • step_<N>_*/.ckpt/<sample_id>.json — per-sample checkpoints used for resume.

Prerequisites

  • Container: nvcr.io/nvidia/tao/tao-toolkit:6.26.3-pyt
  • API access: At least one VLM endpoint (Gemini API key or OpenAI-compatible endpoint capable of image input)

Frequently asked questions about Image Grounding Pipeline

Similar skills