Dataset labeling

From VectorSpaceLab/AREX-Skill · View interactive version

Dataset labeling is an AI agent skill from the GitHub repository VectorSpaceLab/AREX-Skill. Guides Autodistill dataset auto-labeling workflows, output layouts, and safe dummy verification for detection and classification base models.

How to use this skill

Skill file

Autodistill Dataset Labeling

Use this sub-skill when a task asks how to auto-label image folders, inspect or validate Autodistill dataset output, choose CaptionOntology prompts/classes for labeling, use SAHI/NMS during labeling, or debug core .label() behavior without running a real foundation model.

Autodistill's core package supplies base-model interfaces and dataset writers. Real foundation models such as Grounding DINO, Grounded SAM, CLIP, YOLOv8, or cloud plugins live in separate autodistill-* packages and may require downloads, credentials, GPU, or long training. For plugin aliases and CLI orchestration, read the CLI and model registry sub-skill. For implementing a custom model class, read ontologies and model interfaces.

Quick Route

Core Concepts

  1. Build an ontology, usually CaptionOntology({"prompt sent to base model": "saved class name"}).
  2. Instantiate a base model plugin or a custom subclass whose task matches the dataset you want.
  3. Call base_model.label(input_folder=..., extension=".jpg", output_folder=...).
  4. Validate the generated dataset layout before handing it to a target model plugin.

In this source snapshot the verified source method is label(). Some public docs mention label_folder(); treat that as a stale alias unless a concrete plugin adds it. The verified SAHI method on DetectionBaseModel is sahi_predict(), while .label(..., sahi=True) uses supervision.InferenceSlicer internally.

Minimal Programmatic Pattern

from autodistill.detection import CaptionOntology
from autodistill_grounding_dino import GroundingDINO

ontology = CaptionOntology({"milk bottle": "bottle", "bottle cap": "cap"})
base_model = GroundingDINO(ontology=ontology)
base_model.label(input_folder="images", extension=".jpg", output_folder="dataset")

This pattern proves the core call shape. The plugin package, model weights, hardware, and optional training target must be selected and verified separately.

Validation Checklist

Safe Smoke Script

Run the bundled dummy script after installing autodistill and supervision:

python scripts/create_tiny_detection_dataset.py --keep

It uses a deterministic in-process DetectionBaseModel subclass, creates two tiny images, calls the inherited label() implementation, and checks the output layout. Passing this script means the core dataset writer works; it does not verify any external base-model plugin.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.