__getitem__#

Dataset.__getitem__(args: Any) Self[source]#

__getitem__ implementation for the Dataset object. The iteration is made image wise. Constructs a sub dataset so that the image index of that new dataset is the result of self.images[args]. args could be anything like slices, ellipsis and so on.

Note

This is equivalent to calling the dataset indexer Dataset.iloc

Parameters:

args – usual parameters for indexing or slicing a numpy array or a pandas array with iloc. This will be used to index image indices for the returned dataset object.

Returns:

Sub-dataset including image data indices and corresponding annotations