predict#
- maite.tasks.predict(*, model, dataloader=None, dataset=None, batch_size=1, augmentation=None, return_augmented_data=False)[source]#
Make predictions for a given model & data source with optional augmentation.
- Parameters:
- model
SomeModel Maite Model object.
- dataloader
SomeDataloader|None, (default=None) Compatible maite dataloader.
- dataset
SomeDataset|None, (default=None) Compatible maite dataset.
- batch_size
int, (default=1) Batch size for use with dataset (ignored if dataset=None).
- augmentation
SomeAugmentation|None, (default=None) Compatible maite augmentation.
- return_augmented_data
bool, (default=False) Set to True to return post-augmentation data as a function output.
- model
- Returns:
tuple[Sequence[Sequence[SomeTargetType],Sequence[tuple[Sequence[SomeInputType],Sequence[SomeTargetType],Sequence[SomeMetadataType]]],A tuple of the predictions (as a sequence of batches) and a sequence of tuples containing the information associated with each batch. Note that the second return argument will be empty if return_augmented_data is False.
- Raises:
ValueErrorIf neither a dataloader nor a dataset is provided.