技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
dataset-labeling【数据与研究】Guides Autodistill dataset auto-labeling workflows, output layouts, and safe dummy verification for detection and classification base models.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
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.
.label() patterns, ontology setup, SAHI/NMS switches, and Roboflow upload boundaries.data.yaml, YOLO labels, train/valid splits, or classification folders.CaptionOntology({"prompt sent to base model": "saved class name"}).base_model.label(input_folder=..., extension=".jpg", output_folder=...).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.
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.
ontology.classes() contains exactly the labels expected by the target model.input_folder contains files matching extension; default is .jpg only.confidence if record_confidence=True.data.yaml, train/valid image folders, and train/valid label folders.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.