Annotation Queries

Annotation Query Examples

“Show me all images with ground truth annotations”

annotations.count > 0

“Show me all images with at least 4 traffic lights and exactly one truck”

annotations."traffic light" >= 4 AND annotations.truck = 1

“Show me all images that have yellow traffic lights (where color: yellow was specified as annotation-level metadata)”:

annotations."traffic light".color = "yellow"

“Show me all annotations that have a value "yellow" for the metadata field "color" annotation-level metadata)”:

annotations.metadata.color = "yellow"

annotations."traffic light".color = "yellow"

“Show me all images with segmentation annotations”

annotations.segmentation.count > 0

“Show me all images with at least 5 trucks or buses”

annotations.truck + annotations.bus >= 5

“Show me all images with an even number of stop signs”

annotations."stop sign" % 2 = 0

“Show me all images with the categorical label dress for the taxonomy clothing_type”

annotations.clothing_type = dress

“Show me all images without the categorical label trousers for the taxonomy clothing_type”

annotations.clothing_type != trousers

Annotation Query Details

annotations.Prefix for all annotation-based queries
annotations.countThe total number of annotations in the dataset item
annotations.[class_name]The number of [class name] annotations in the dataset item, of any geometric type
annotations.[class_name].[metadata_field_name]The value of the [metadata_field_name] annotation-level metadata attribute. Only annotations with label=[class_name] will be considered.
annotations.metadata.[metadata_field_name]The value of the [metadata_field_name] annotation-level metadata attribute
annotations.[annotation_type].Prefix to filter based on annotation types. Useful to filter based on counts for a particular type of annotation, or if you have different annotation types (e.g., bounding boxes and instance segmentations) with identical class names, and you need to specify one of them in particular. [annotation_type] can be one of: box, polygon, segmentation, category
annotations.[annotation_type].countThe number of annotations of type [annotation_type] in the dataset item
annotations.[annotation_type].[class_name]The number of [class name] annotations of type [annotation_type] in the dataset item
annotations.[taxonomy_name]The [class_name] of the category annotation with taxonomy name [taxonomy_name] for the dataset item