ValidBboxAnnotationsDataset#

class ethology.validators.annotations.ValidBboxAnnotationsDataset(dataset)[source]#

Bases: ValidDataset

Class for valid ethology bounding box annotations datasets.

This class validates that the input dataset:

  • is an xarray Dataset,

  • has image_id, space, id as dimensions,

  • has position and shape as data variables,

  • both data variables span at least the dimensions image_id, space and id.

dataset#

The xarray dataset to validate.

Type:

xarray.Dataset

required_dims#

The set of required dimension names: image_id, space and id.

Type:

set[str]

required_data_vars#

A dictionary mapping data variable names to their required minimum dimensions:

  • position maps to image_id, space and id,

  • shape maps to image_id, space and id.

Type:

dict[str, set]

Raises:
  • TypeError – If the input is not an xarray Dataset.

  • ValueError – If the dataset is missing required data variables or dimensions, or if any required dimensions are missing for any data variable.

Notes

The dataset can have other data variables and dimensions, but only the required ones are checked.