fiftyone.core.annotation.validate_label_schemas#

Annotation label schema validation

Copyright 2017-2026, Voxel51, Inc.

Exceptions:

ValidationErrors

Validation errors for label schemas

Functions:

validate_label_schemas(sample_collection,ย ...)

Validates label schemas for a fiftyone.core.collections.SampleCollection.

exception fiftyone.core.annotation.validate_label_schemas.ValidationErrors#

Bases: ExceptionGroup

Validation errors for label schemas

Methods:

add_note

Exception.add_note(note) -- add a note to the exception

derive

split

subgroup

with_traceback

Exception.with_traceback(tb) -- set self.__traceback__ to tb and return self.

Attributes:

args

exceptions

nested exceptions

message

exception message

add_note()#

Exception.add_note(note) โ€“ add a note to the exception

args#
derive()#
exceptions#

nested exceptions

message#

exception message

split()#
subgroup()#
with_traceback()#

Exception.with_traceback(tb) โ€“ set self.__traceback__ to tb and return self.

fiftyone.core.annotation.validate_label_schemas.validate_label_schemas(sample_collection, label_schema, fields=None, _allow_default=False)#

Validates label schemas for a fiftyone.core.collections.SampleCollection. See generate_label_schemas() for acceptable label schema specifications

Parameters:
  • sample_collection โ€“ the fiftyone.core.collections.SampleCollection

  • label_schema โ€“ a label schemas dict or an individual fieldโ€™s label schema dict if only one field is provided

  • fields (None) โ€“ a field name, embedded.field.name or iterable of such values

Raises:

ValidationErrors โ€“ if the label schema(s) are invalid