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:
- modelSomeModel
Maite Model object.
- dataloaderSomeDataloader | None, (default=None)
Compatible maite dataloader.
- datasetSomeDataset | None, (default=None)
Compatible maite dataset.
- batch_sizeint, (default=1)
Batch size for use with dataset (ignored if dataset=None).
- augmentationSomeAugmentation | None, (default=None)
Compatible maite augmentation.
- return_augmented_databool, (default=False)
Set to True to return post-augmentation data as a function output.
- 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:
- InvalidArgument
If neither a dataloader nor a dataset is provided.