maite.protocols.object_detection.DataLoader#
- class maite.protocols.object_detection.DataLoader(*args, **kwargs)[source]#
A dataloader protocol for the object detection ML subproblem providing batch-level data access.
Implementers must provide an iterable object (returning an iterator via the
__iter__
method) that yields tuples containing batches of data. These tuples contain typesSequence[ArrayLike]
(elements of shape(C, H, W)
),Sequence[ObjectDetectionTarget]
, andSequence[DatumMetadataType]
, which correspond to model input batch, model target batch, and a datum metadata batch.Note: Unlike Dataset, this protocol does not require indexing support, only iterating.
Methods
__iter__ -> Iterator[tuple[Sequence[ArrayLike], Sequence[ObjectDetectionTarget], Sequence[DatumMetadataType]]]
Return an iterator over batches of data, where each batch contains a tuple of of model input batch (as
Sequence[ArrayLike]
), model target batch (asSequence[ObjectDetectionTarget]
), and batched datum-level metadata (asSequence[DatumMetadataType]]
), respectively.