Tool Reference

Label Operations

Refine your annotation taxonomy without manual relabeling. These tools let you rename classes for consistency, remove unwanted labels, and query label distributions — all with automatic dataset-type detection for classification, detection, segmentation, keypoints, and OCR.

modify_labels

Async Job

Modify labels in a dataset — remove unwanted classes or rename/remap class names. Automatically handles reindexing of remaining classes across all annotation files. Supports classification, detection, segmentation, keypoints, and OCR datasets.

Parameters

dataset_namestring
Name of the dataset.
Required
actionstring
"remove" to delete classes, "replace" to rename classes.
Required
labels_to_removelist[string]
Classes to remove (when action is "remove").
Optional
label_mappingdict
Old→new name mapping, e.g. {"person": "human"} (when action is "replace").
Optional
old_labelstring
Single label to rename (alternative to label_mapping).
Optional
new_labelstring
New name for old_label.
Optional
branch_namestring
Branch to operate on. Defaults to "main".
Optional

Returns

Job ID for tracking progress via get_processing_status. Creates a new dataset version — original data is preserved.

Example prompt

Remove the classes "Scissors" and "Knife" from my airport-xray dataset

query_dataset

Instant

Query dataset labels and images. Returns instant results from the database without running compute jobs. Use "count_labels" to get label distribution or "find_images" to locate images containing a specific class.

Parameters

dataset_namestring
Name of the dataset.
Required
actionstring
"count_labels" (default) or "find_images".
Optional
labelstring
Label to search for (required for find_images).
Optional
exclusiveboolean
If true, only return images that contain exclusively this label.
Optional
branch_namestring
Branch to query. Defaults to "main".
Optional

Returns

For count_labels: object mapping class names to counts. For find_images: list of image filenames matching the query.

Example prompt

How many images of each class are in my retail-detection dataset?

Behavior by dataset type

ClassificationRemoves/renames classes. Images belonging exclusively to removed classes are deleted.
DetectionRemoves/renames bounding box classes. Images are kept unless all annotations are removed.
SegmentationUpdates polygon/mask annotations. Preserves segmentation data for remaining classes.
KeypointsUpdates keypoint annotations. Preserves visibility flags and coordinates.
OCRRemoves text regions matching exact text. For replacement, updates the text content.

Non-destructive: Label operations create a new version of your dataset. Your original data is always preserved and you can revert at any time.