indexing#

Module dedicated to Dataset indexers, to be able to index Dataset with pandas style loc and iloc methods

Classes

DatasetAnnotLocator(dataset[, mode, ...])

Locator class dedicated to index a dataset by its annotations as if we used pandas indexing methods on dataset.annotations and potentially filtered empty images accordingly.

DatasetImLocator(dataset[, mode])

Locator class dedicated to index a dataset by its images as if we used pandas indexing methods on dataset.images and filtered annotations accordingly.

class DatasetAnnotLocator(dataset: D, mode: Literal['loc', 'iloc'] = 'loc', remove_emptied_images: bool = False)[source]#

Locator class dedicated to index a dataset by its annotations as if we used pandas indexing methods on dataset.annotations and potentially filtered empty images accordingly.

Usually used in the context of Dataset.loc_annot() and Dataset.iloc_annot()

Constructor

Parameters:
  • dataset – Dataset object to index

  • mode – whether to use dataset.annotations.loc or dataset.annotations.iloc. Defaults to “loc”

  • remove_emptied_images – If se to True, will remove images that no longer have annotations, but will keep images that were already empty before. Defaults to False

class DatasetImLocator(dataset: D, mode: Literal['loc', 'iloc'] = 'loc')[source]#

Locator class dedicated to index a dataset by its images as if we used pandas indexing methods on dataset.images and filtered annotations accordingly.

Usually used in the context of Dataset.loc() and Dataset.iloc()

Constructor

Parameters:
  • dataset – Dataset object to index

  • mode – whether to use dataset.images.loc or dataset.images.iloc. Defaults to “loc”